Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Might be worth adding - if you're not activating the sheets as you loop
through them, it seems you have to refer to them by name as opposed to using their indexes. "slarbie" wrote: 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 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks for the help.
"slarbie" wrote: Might be worth adding - if you're not activating the sheets as you loop through them, it seems you have to refer to them by name as opposed to using their indexes. "slarbie" wrote: 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
set command button on a worksheet | Excel Programming | |||
Command Button On A Worksheet | Excel Programming | |||
Command button on worksheet | Excel Programming | |||
Command Button on worksheet | Excel Programming | |||
command button on worksheet | Excel Programming |