Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 90
Default switch to another worksheet, then return to original sheet

I have recorded a macro that daily copies a row of data on the current worksheet, then goes to a sheet named "data" and appends this data to a list. I want to have the macro return to the current sheet. However, I add a sheet every day and so the name of the current sheet is different every day. How can i accomplish this?

Thanks,

Tonso
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,872
Default switch to another worksheet, then return to original sheet

Hi Tonso,

Am Thu, 6 Sep 2012 11:13:25 -0700 (PDT) schrieb Tonso:

I have recorded a macro that daily copies a row of data on the current worksheet, then goes to a sheet named "data" and appends this data to a list. I want to have the macro return to the current sheet. However, I add a sheet every day and so the name of the current sheet is different every day. How can i accomplish this?


first get the name of the current (active) sheet. Then run your code and
return to the current sheet:

shName = ActiveSheet.Name
'your code
Application.Goto Sheets(shName).Range("A1")


Regards
Claus Busch
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 90
Default switch to another worksheet, then return to original sheet

On Thursday, September 6, 2012 2:13:26 PM UTC-4, Tonso wrote:
I have recorded a macro that daily copies a row of data on the current worksheet, then goes to a sheet named "data" and appends this data to a list. I want to have the macro return to the current sheet. However, I add a sheet every day and so the name of the current sheet is different every day. How can i accomplish this? Thanks, Tonso


Claus,
Thank you so very much!

Tonso
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
Switch to change data fields to 0's, then back to original data? mapleleafmike Excel Discussion (Misc queries) 0 July 8th 08 02:25 PM
Hyperlink to web does not return to original Excel worksheet g. spence Excel Discussion (Misc queries) 1 November 23rd 07 05:04 PM
return to original sheet Dave Peterson Excel Programming 1 January 24th 07 04:37 PM
return to original sheet Susan Excel Programming 0 January 24th 07 04:16 PM
Relative return to original worksheet in middle of macro [email protected] Excel Programming 2 June 2nd 06 06:52 PM


All times are GMT +1. The time now is 05:01 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"