Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Refer to command button on Excel sheet from form 1

Status
Not open for further replies.

MDA

Technical User
Jan 16, 2001
243
US
HI all,

I am trying to enable a command button on an Excel sheet from a form...

I can use:
Sheet1.cmdOpen.enabled = true

However, I need to copy this code to several workbooks so I do not want to refer to a sheet number, rather the name of the sheet.

Thanks for any help...

Regards,

Mike
 
Hi Mike,

Try this:

Code:
ThisWorkbook.Worksheets("YourSheetName").cmdOpen.Enabled = True


HTH
Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top