Quote:
I have created a button to take me to anoher sheet, however I only want the button to become active once the value within a cell satisfys certain criteria,ie <>0
Help appreciated cos holding up college assignment!!
|
Hi,
Are you using the button from View, Toolbars, Forms or View, Toolbars, Control Toolbox? If you're using the second type then doing what you want is fairly easy...
Right click the worksheet tab and choose View Code. Then try something like this:-
Code:
Private Sub Worksheet_Calculate()
CheckA1
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
CheckA1
End Sub
Sub CheckA1()
If Range("A1") <> 0 Then
Me.CommandButton1.Enabled = True
Else
Me.CommandButton1.Enabled = False
End If
End Sub
You'll have to change the name of your command button to match the name of yours.
HTH,
D