View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Haldun Alay[_3_] Haldun Alay[_3_] is offline
external usenet poster
 
Posts: 42
Default How I disable a command button until cell has value?

Hi,

you need to put some code to sheet1's worksheet_change event.

Private Sub Worksheet_Change(ByVal Target As Range)
if range("E41").value="For Contract" then
'assumed that commandbutton located on sheet2 and name is commandbutton1
sheet2.commandbutton1.enabled=true
end if
End Sub

--

To e-mail me, please remove AT and DOT from my e-mail address.



"Brian" , iletide sunu yazdi
...
I have a workbook with many worksheets(25), on one
worksheet is a command button that when clicked locks all
cells in all worksheets, once all the data required is
entered. What I need is to disable this button until a
cell on the first worksheet has a specific value, can
anyone please help with the necessary code or macro?

The appropriate cell is E41 on sheet1, it has to have the
value "For Contract" to allow the button to be used.

Thank you in advance for any assistance.

Brian