ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Need help with codes please (https://www.excelbanter.com/excel-programming/380391-re-need-help-codes-please.html)

Bob Phillips

Need help with codes please
 
Perhaps it should be

activesheet.oleobjects("chkId").object.value

--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)


"ernie" wrote in message
...
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






All times are GMT +1. The time now is 04:56 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com