Macro does nothing if ran in certain worksheet?
Just check for the activesheet at the top of the code
Select Case lcase(activesheet.name)
' sheets not to run with
Case "sheet1", "sheet5", "sheet7"
exit sub
End Select
' code continues
--
Regards,
Tom Ogilvy
Stu wrote in message
...
My problem with doing that is I have 12 sheets, 9 of which I need a macro
that is on a toolbar to be ran but the other 3 will go very badly wrong if
the macro is ran in them any other ideas?
--
Thanks
--
Stu
"Peter Atherton" wrote in message
...
Stu
Put your code in the sheet code not a module. Right_Click
the worksheet tab and select View code. Then cut and paste
the macro into the sheet code.
Regards
Peter
-----Original Message-----
Hello,
Is it possible to get a macro to do nothing if it is ran
in a certain sheet
but to do something in the sheets it is meant for?
Thanks
--
Stu
.
|