ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Hide command button on worksheet (https://www.excelbanter.com/excel-programming/271632-hide-command-button-worksheet.html)

Mohair

Hide command button on worksheet
 
Can some please tell me how can I hide a command button
from users which depend on who open the workbook ?

My idea is:
select case Application.UserName
' List of regular user
Case "Moham"
Case "John"
Hide_Cmd_Btn=True
' List of special users
Case "Jad"
Case "Theresa"
Hide_Cmd_Btn=False
end Case
If Hide_Cmd_Btn
VBA code to hide the command btn.
End If

Myrna Larson[_2_]

Hide command button on worksheet
 
There doesn't seem to be a Visible property for command buttons. You can, however, disable it
via the Enabled property.

On Mon, 14 Jul 2003 14:29:52 -0700, "Mohair" wrote:

Can some please tell me how can I hide a command button
from users which depend on who open the workbook ?

My idea is:
select case Application.UserName
' List of regular user
Case "Moham"
Case "John"
Hide_Cmd_Btn=True
' List of special users
Case "Jad"
Case "Theresa"
Hide_Cmd_Btn=False
end Case
If Hide_Cmd_Btn
VBA code to hide the command btn.
End If



Tim Zych[_2_]

Hide command button on worksheet
 
Select Case Application.UserName

Rohit Thomas

Hide command button on worksheet
 
If you're command button is on a worksheet, you can use
set the visible property of the button to true/false to
show or hide the button.

With Sheets("SheetNameHere")
.CommandButton1.Visible = False
.CommandButton2.Visible = True
End With

Rohit
-----Original Message-----
Can some please tell me how can I hide a command button
from users which depend on who open the workbook ?

My idea is:
select case Application.UserName
' List of regular user
Case "Moham"
Case "John"
Hide_Cmd_Btn=True
' List of special users
Case "Jad"
Case "Theresa"
Hide_Cmd_Btn=False
end Case
If Hide_Cmd_Btn
VBA code to hide the command btn.
End If
.



All times are GMT +1. The time now is 08:27 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com