Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
What is wrong with this code?
Matt,
This works for me Sub TestStuff() Dim MBT As String Dim fc As OLEObject Dim t As Integer If ActiveSheet.Name = "TIME AND LEAVE" Then For Each fc In ActiveSheet.OLEObjects If TypeOf fc.Object Is MSForms.CheckBox Then t = CInt(Mid$(fc.Name, 9)) With ActiveSheet If .Range("Cell" & t).Value < "" Then .OLEObjects("CheckBox" & t).Visible = False Else .OLEObjects("CheckBox" & t).Visible = True End If End With End If Next fc End If End Sub -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "Matt" wrote in message ... I can't seem to figure out what is wrong w/ this code. I keep getting an object required error. Thanks. Sub TestStuff() Dim MBT As String Dim fc As OLEObject Dim t As Integer If ActiveSheet.Name = "TIME AND LEAVE" Then For Each fc In OLEObjects If TypeOf fc.Object Is MSForms.Checkbox Then t = CInt(Mid$(fc.Name, 9)) With ActiveSheet For t = 2 To 30 If ActiveSheet.Range("Cell" & t).Value < "" Then ActiveSheet.OLEObjects("CheckBox" & t).Visible = False Else ActiveSheet.OLEObjects("CheckBox" & t).Visible = True End If Next End With End If Next fc End If End Sub |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
What is wrong with this code?
I got it figured out. Thanks, Bob.
|
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
What is wrong with this code? | Excel Discussion (Misc queries) | |||
What is wrong with this code? | Excel Discussion (Misc queries) | |||
Can someone tell me what is wrong with this code? | Excel Discussion (Misc queries) | |||
What's wrong with my code ? | Excel Worksheet Functions | |||
What's wrong with this bit of code | Excel Programming |