Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
MLK MLK is offline
external usenet poster
 
Posts: 81
Default Need to identify active worksheet in macro

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
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 709
Default Need to identify active worksheet in macro

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

"MLK" wrote in message
...
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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to identify active Menu Bars Matz Excel Discussion (Misc queries) 3 August 6th 06 08:21 PM
macro- move down to empty cell & active worksheet EducatingMom Excel Worksheet Functions 3 August 4th 06 11:02 PM
Is there a macro to identify and remove duplicate data in Excel? Cindy Lou Excel Worksheet Functions 3 March 9th 06 03:10 AM
Identify current active cell reades Excel Worksheet Functions 6 January 10th 06 12:48 PM
How do I build a Macro that can identify wooksheet names peter147 Excel Discussion (Misc queries) 4 May 22nd 05 04:26 PM


All times are GMT +1. The time now is 05:37 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"