Limiting macro to a single spreadsheet

Closed
frasermac - 13 Sep 2009 à 05:39
Excelguru Posts 261 Registration date Saturday 11 April 2009 Status Member Last seen 21 June 2011 - 13 Sep 2009 à 06:38
Hello,
I have a simple macro which saves a spreadsheet to a memory stick for backup purposes via 'ctrl shift S'. If a second spreadsheet is opened the same ctrl shift S will save this spreadsheet to the stick and overwrite the previously saved file causing general confusion. I would like to able to link the macro to a specific spreadsheet and be sure that it only runs when activated from that spreadsheet. I hope this is possible ?
Related:

1 response

Excelguru Posts 261 Registration date Saturday 11 April 2009 Status Member Last seen 21 June 2011 307
13 Sep 2009 à 06:38
hi
just use
if activesheet.name<>"something" then exit sub
after any declarations