Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 24
Default Return to active cell

I am working with two sheets in the same workbook. I move between the two
sheets using active buttons with assigned macros. How do I get the macro in
the second sheet to return to the active cell in the first sheet?

Many thanks
Alex.W
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,942
Default Return to active cell

hi,
add code like this or similar in the macro
sub mac1()
dim sh as worksheet
dim rng as range
set sh = activeworksheet 'remember this sheet
set rng = activecell 'remember this cell
Sheets("sheet2").Activate
'do macro stuff
sh.Activate 'return to previouse active sheet
rng.Select 'return to previouse active cell
End Sub

regards
FSt1

"Alex.W" wrote:

I am working with two sheets in the same workbook. I move between the two
sheets using active buttons with assigned macros. How do I get the macro in
the second sheet to return to the active cell in the first sheet?

Many thanks
Alex.W

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 24
Default Return to active cell

Thanks very much, it certainly helped.
Alex.W

"FSt1" wrote:

hi,
add code like this or similar in the macro
sub mac1()
dim sh as worksheet
dim rng as range
set sh = activeworksheet 'remember this sheet
set rng = activecell 'remember this cell
Sheets("sheet2").Activate
'do macro stuff
sh.Activate 'return to previouse active sheet
rng.Select 'return to previouse active cell
End Sub

regards
FSt1

"Alex.W" wrote:

I am working with two sheets in the same workbook. I move between the two
sheets using active buttons with assigned macros. How do I get the macro in
the second sheet to return to the active cell in the first sheet?

Many thanks
Alex.W

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
Compare Value in Cell 1 to a List, Return Value if Match otherwise Return Null Ben Excel Discussion (Misc queries) 2 March 15th 07 01:02 AM
value of the active cell caroline Excel Worksheet Functions 2 June 21st 06 05:34 PM
Function to return the active sheet name Will Excel Worksheet Functions 2 August 23rd 05 04:33 PM
HOW TO COPY 480 ACTIVE E-MAIL ADDRESSES CLM "G" ON AN ACTIVE EXCE. ragman10 Excel Discussion (Misc queries) 1 December 13th 04 11:52 PM
Sum to active cell GregR Excel Discussion (Misc queries) 4 December 10th 04 10:01 PM


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