View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
slarbie slarbie is offline
external usenet poster
 
Posts: 53
Default Referencing command button on worksheet from VBA


Activesheet.Shapes("CommandButton1").Visible = false

where you replace CommandButton1 with the actual names. works whether they
came from the controls or the forms toolbar


"Ken Warthen" wrote:

I have several command buttons on a worksheet in an Excel 2007 workbook. I
have a login form that hides/shows worksheets based on the login name of
either Administrator or User. If the login is User I also want to change the
visible property of some of the command buttons to false. I'm having trouble
figuring out how to reference the command buttons on the worksheet from the
VBA module of the login form. Any help or direction would be greatly
appreciated.

Ken