Re: Need help with codes please

Tech-Archive recommends: Speed Up your PC by fixing your registry



Perhaps it should be

active***.oleobjects("chkId").object.value

--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)


"ernie" <ernie@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:7907292E-71C8-4CF6-989C-637534828763@xxxxxxxxxxxxxxxx
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




.


Quantcast