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!

Command Button Limits 1

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
How do I limit the use of a command button to a specific worksheet/worksheets, with a popup message for effect?
 
More info please - what do you want to limit??
Where is the button located ??
HTH
~Geoff~
[lightsaber]
 
It's on a userform in a Workbook Template. I want the command to work on certain sheets only. The trouble is other users have use of the workbook and will misuse the command, so i need to limit its use.

 
If your sheetnames are standard, then just use an if statement to preclude the use on the sheets you don't want
eg
mSheet = activesheet.name
Select Case mSheet
case "Sheet1","Sheet2","Sheet3"
--do stuff
case else
msgbox "You can't use that command on sheet " & msheet
end select
HTH
~Geoff~
[lightsaber]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top