Need to identify active worksheet in macro

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Currently I have 10 pivot reports in one Excel spreadsheet. I built in one
macro to go through and format all 10 reports for printing at one time ...
with the first tab report being the last report that's formatted. The
problem is that if someone is on tab 4 and runs the macro, the macro does its
thing by formatting all reports however the person ends back up in tab 1
report. This will occur on all tabs.

Is there a way to tell in the macro which sheet the user ran the macro from
and take them right back to that same sheet?

Thanks, Mary-Lou
 
MLK, try something like this

Dim CS As Worksheet
Set CS = ActiveSheet
'Your code here
CS.Select

--
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
 

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