View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
mangesh_yadav[_331_] mangesh_yadav[_331_] is offline
external usenet poster
 
Posts: 1
Default Enable Command Button 1 & 2


Private Sub CommandButton1_Click()
CommandButton1.Enabled = False
' your code here
End Sub

Private Sub CommandButton2_Click()
CommandButton2.Enabled = False
' your code here
End Sub

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$B$6" And Target.Value = 0 And Target.Value
<= 9999 Then
CommandButton1.Enabled = True
CommandButton2.Enabled = True
End If
End Sub


should go in the module of the concerned sheet

Mangesh


--
mangesh_yadav
------------------------------------------------------------------------
mangesh_yadav's Profile: http://www.excelforum.com/member.php...o&userid=10470
View this thread: http://www.excelforum.com/showthread...hreadid=379981