View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
JB2010 JB2010 is offline
external usenet poster
 
Posts: 44
Default When Sheet Is Active, Run Macro, Otherwise Dont

Hi

thanks for that, looks good, but it isnt firing, probably because my initial
code was dump

when the specific sheet become active, i just want an OKOnly MsgBox to turn
up & issue a warning. So ive now got this....

--------------------------------------------------------------
Sub TESTM1()
If ActiveSheet.Name < ("Validation Lists") Then Exit Sub

MsgBox "For Editors Only", vbOKOnly, "CAUTION!!!"

End Sub
-------------------------------

any thoughts on how to fix this?


thanks again for your help, sorry for the rather unstimulating level of
complexity!!!





"Tom Ogilvy" wrote:

Sub MyMacro()
if Activesheet.Name < "Sheet2" then exit sub

' current code

end Sub

--
Regards,
Tom Ogilvy


"JB2010" wrote:

Hi


Ive been trawling through previous postings to try & find an answer to this
as it must be so simple, but to no avail.


All i need is the code that tells VBA "When 'Sheet 2' is active
(i.e.visable), run the macro, otherwise dont".

Sorry that this is so lame! Please let me know if you need anymore info


cheers


jb