Limiting macros to certain sheets

G

Giselle

Hi
Newbie question, I think

I have some macros in my workbook that are activated by <ctrl><shift>A,
<ctrl><shift>B, <ctrl><shift>C, etc. My prob is that they work on EVERY
sheet, but i'd like them to work only on certain designated sheets. Any
ideas how to go about this?

Merci
Giselle
 
P

Paul B

Giselle, you could check for the sheet name like this,

Sub test()
If ActiveSheet.Name = "Sheet2" Then
'Your Code here
Else
Exit Sub
End If
End Sub



--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003
 
Top