P
peter.thompson
I'm trying to use the following code from a userform to lock up
commandbuttons on a worksheet. I get a compile error "method or data
member not found, where indicated in red. I'm sure I'm doing something
basically wrong, any help appreciated.
Cheers
Peter
If Sheet6.Range("F49") = 0 Then
If Sheet6.Range("F59").Text = Sheet6.Range("F50").Text Then
MsgBox ("Application has been successfully activated"),
vbApplicationModal, "Message"
'Unlock Boxes code goes here
Else
Sheet7.Select
Dim rng As Range
Dim i As Long
Const sAdd As String = "A100:A129"
Const NumOfButtons As Long = 30
Dim OleObj As OLEObject
Set rng = *Me.Range*(sAdd).Resize(NumOfButtons)
For i = 1 To NumOfButtons
With Me.OLEObjects("Commandbutton" & i).Object
If rng(i).Value <> "" Then
..Locked = True
Else
..Locked = False
End If
End With
Next i
commandbuttons on a worksheet. I get a compile error "method or data
member not found, where indicated in red. I'm sure I'm doing something
basically wrong, any help appreciated.
Cheers
Peter
If Sheet6.Range("F49") = 0 Then
If Sheet6.Range("F59").Text = Sheet6.Range("F50").Text Then
MsgBox ("Application has been successfully activated"),
vbApplicationModal, "Message"
'Unlock Boxes code goes here
Else
Sheet7.Select
Dim rng As Range
Dim i As Long
Const sAdd As String = "A100:A129"
Const NumOfButtons As Long = 30
Dim OleObj As OLEObject
Set rng = *Me.Range*(sAdd).Resize(NumOfButtons)
For i = 1 To NumOfButtons
With Me.OLEObjects("Commandbutton" & i).Object
If rng(i).Value <> "" Then
..Locked = True
Else
..Locked = False
End If
End With
Next i