B
brettmanning24
Hello,
I would like to disable / enable depending on a Cells value. For
example if cell A1 = "OK" enable the command button, if the Cell
equals anything else I would like it disabled.
Public Sub Worksheet_Change(ByVal Target As Range)
With Target
If .Address = "Home!$C$13" Then
If .Value = "OK" Then
Me.OLEObject("cmdFX").Enabled = True
Else
Me.OLEObject("cmdFX").Enabled = False
End If
End If
End With
End Sub
My sheet name is called "HOME", I have tried the VB code above but it
does not work. Can anyone help?
Thanks in advance.
Brett
I would like to disable / enable depending on a Cells value. For
example if cell A1 = "OK" enable the command button, if the Cell
equals anything else I would like it disabled.
Public Sub Worksheet_Change(ByVal Target As Range)
With Target
If .Address = "Home!$C$13" Then
If .Value = "OK" Then
Me.OLEObject("cmdFX").Enabled = True
Else
Me.OLEObject("cmdFX").Enabled = False
End If
End If
End With
End Sub
My sheet name is called "HOME", I have tried the VB code above but it
does not work. Can anyone help?
Thanks in advance.
Brett