Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Relative return to original worksheet in middle of macro

Hi -

I'm making a macro that is used for many workbooks that will all have a
different worksheet names (sheet, sheet2, etc...). The macro creates
two new worksheets then it needs to return to the original worksheet to
perform an action. So right in the middle of the macro, it needs to
return to the original worksheet but that worksheet will always have a
different name - is there anyway to do that? I couldn't find it or
figure it out - I thought there was just some easy command, maybe?

Thanks
A

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Relative return to original worksheet in middle of macro

Dim sh as Worksheet
set sh = Activesheet

. . .

' now return to original sheet
sh.Activate

--
Regards,
Tom Ogilvy


" wrote:

Hi -

I'm making a macro that is used for many workbooks that will all have a
different worksheet names (sheet, sheet2, etc...). The macro creates
two new worksheets then it needs to return to the original worksheet to
perform an action. So right in the middle of the macro, it needs to
return to the original worksheet but that worksheet will always have a
different name - is there anyway to do that? I couldn't find it or
figure it out - I thought there was just some easy command, maybe?

Thanks
A


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Relative return to original worksheet in middle of macro

Thanks much.


Tom Ogilvy wrote:
Dim sh as Worksheet
set sh = Activesheet

. . .

' now return to original sheet
sh.Activate

--
Regards,
Tom Ogilvy


" wrote:

Hi -

I'm making a macro that is used for many workbooks that will all have a
different worksheet names (sheet, sheet2, etc...). The macro creates
two new worksheets then it needs to return to the original worksheet to
perform an action. So right in the middle of the macro, it needs to
return to the original worksheet but that worksheet will always have a
different name - is there anyway to do that? I couldn't find it or
figure it out - I thought there was just some easy command, maybe?

Thanks
A



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
Macro to return to original cell Tonso Excel Discussion (Misc queries) 1 April 1st 10 02:48 AM
How write Macro to save worksheet to a RELATIVE address Barry Excel Discussion (Misc queries) 10 May 1st 08 08:24 PM
Hyperlink to web does not return to original Excel worksheet g. spence Excel Discussion (Misc queries) 1 November 23rd 07 05:04 PM
Copying formulas (relative) give always original value Eddyd Excel Worksheet Functions 5 May 12th 05 11:44 AM
How to insert carriage return in the middle of a text formula to . Dave Excel Discussion (Misc queries) 2 March 17th 05 02:14 PM


All times are GMT +1. The time now is 09:35 AM.

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

About Us

"It's about Microsoft Excel"