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 TugboatEng on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Macro to exit spreadsheet file

Status
Not open for further replies.

tashu

Computer
Joined
Apr 26, 2008
Messages
1
Location
GB
Hi,

I was wondering if any of you can help me with VBA code or else so i can add a button wth macro function on it which will automatically close the spreadsheet system open.

and i am not sure whether this is possible or not
BUT can we password protect macros? So that if we have to run certain macro, it should ask us for some password before it runs or carry out its function.


Thanks
your help will really be appreiciated
 
To close worksheet by macro, use worksheet_deactivate()

If the macro is on the sheet and the sheet is protected, the macro cannot run as the macro cannot activate the sheet to perform.

Robert Mote
 
Here's some sample code you can try to protect a macro with a password. Enjoy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top