Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 225
Default Need help with codes please

I would guess that chkID is not defined in the context that
you are using it in. If the code is in a module (or is code-behind for
a worksheet) and the checkbox is on a form then you would need
to qualify the name it with the name of the form it's on - e.g.
UserForm1.chkID

If this is right, it would also help you if you had Option Explicit
at the top of the module - this would pick up the fact that you
were using an undefined vraible.




ernie wrote:

Hello

I get an error with my code below. when i put in "chkID.value = false", it
tells me object is required. but if i leave it as "chkID = false", it doesnt
recognise the check on the checkbox. what am i doing wrong?

Sub UpdateCPC()
If chkID.Value = False Then
ActiveCell.Offset(0, 1).Value = "0"
Else
ActiveCell.Offset(0, 1).Value = "1"
End If

If chkESC.Value = False Then
ActiveCell.Offset(0, 2).Value = "0"
Else
ActiveCell.Offset(0, 2).Value = "1"
End If

If chkCSC.Value = False Then
ActiveCell.Offset(0, 3).Value = "0"
Else
ActiveCell.Offset(0, 3).Value = "1"
End If

If chkET.Value = False Then
ActiveCell.Offset(0, 4).Value = "0"
Else
ActiveCell.Offset(0, 4).Value = "1"
End If

If chkVAT.Value = False Then
ActiveCell.Offset(0, 5).Value = "0"
Else
ActiveCell.Offset(0, 5).Value = "1"
End If

End Sub


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Codes Heather Excel Worksheet Functions 4 March 23rd 06 11:41 PM
Bar Codes [email protected] Excel Discussion (Misc queries) 4 August 31st 05 08:12 AM
re : Help Need on my codes ddiicc Excel Programming 2 August 17th 05 05:37 AM
Zip Codes [email protected] Excel Discussion (Misc queries) 10 November 27th 04 05:23 PM
where are my VB codes Jane[_4_] Excel Programming 1 October 23rd 03 11:50 PM


All times are GMT +1. The time now is 08:00 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"