Jump out of Do Loop on sheet change

  • Thread starter Thread starter Paul
  • Start date Start date
P

Paul

Hello All
In Office XP I have a separate Do Loop code running for each of 3 sheets. I
would like the Do Loop code for a sheet to run only if that sheet is
visible. I would like to jump out of the do loop on a sheet change. Right
now when I exit a sheet the code for that sheet keeps going.
Any suggestions would be much appreciated
Paul
 
do while true
if activesheet.Name <> me.name then exit sub
doevents
Loop
 
Thank you Tom
Paul
-----Original Message-----
do while true
if activesheet.Name <> me.name then exit sub
doevents
Loop

--
Regards,
Tom Ogilvy


each of 3 sheets.
I


.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top