View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
NickHK NickHK is offline
external usenet poster
 
Posts: 4,391
Default Refer to a control name from another sheet

Sure it's called "commandbutton" ?

This works for me:

'This is on Worksheets(2)
Private Sub CommandButton1_Click()
Worksheets(1).CommandButton1.Enabled = False
End Sub

NickHK

"rezafloyd" wrote in message
ups.com...
Dear experts,
I embed a command button on sheet1 on a an excel workbook.
I'd like to change it's 'enabled' property at run time from a code in
sheet2.
How can I refer to it's name? (ex. 'worksheets(1).commandbutton.enabled
=false' doesn't work)
Regards,
reza