Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Macro to return to Current Sheet and Cell

I have a macro that is used in several different areas in my workbook. The
macro changes values in several sheets from the sheet I'm on...and that all
works.

I'd like the macro to return me to whatever active sheet and cell I am
currently at....how can I accomplish this?

Thanks
Steve

--


----------------------------------------------------
This mailbox protected from junk email by MailFrontier Desktop
from MailFrontier, Inc. http://info.mailfrontier.com


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 227
Default Macro to return to Current Sheet and Cell

'Place this at the start of your macro.....

Dim wb as workbook
Dim ws as worksheet
Dim c as range

set wb=activeworkbook
Set ws=wb.activesheet
set c=activecell

'Your code here

'Place this at the end of your macro.....
wb.activate
ws.select
c.select


--


XL2003
Regards

William



"Steve Klenner" wrote in message
...
I have a macro that is used in several different areas in my workbook. The
macro changes values in several sheets from the sheet I'm on...and that all
works.

I'd like the macro to return me to whatever active sheet and cell I am
currently at....how can I accomplish this?

Thanks
Steve

--


----------------------------------------------------
This mailbox protected from junk email by MailFrontier Desktop
from MailFrontier, Inc.
http://info.mailfrontier.com




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Macro to return to Current Sheet and Cell

Hi Steve:

In Addition to William's suggestion, try amending your code to avoid sheet
and range selections: most manipulation can be effected without making such
selections.

---
Regards,
Norman



"Steve Klenner" wrote in message
...
I have a macro that is used in several different areas in my workbook. The
macro changes values in several sheets from the sheet I'm on...and that all
works.

I'd like the macro to return me to whatever active sheet and cell I am
currently at....how can I accomplish this?

Thanks
Steve

--


----------------------------------------------------
This mailbox protected from junk email by MailFrontier Desktop
from MailFrontier, Inc. http://info.mailfrontier.com




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
Return range of cell values based on current date WingH Excel Worksheet Functions 1 March 31st 10 07:35 PM
Macro for Graphing Current Sheet? Losse Excel Programming 6 July 5th 05 01:37 PM
Return number of current sheet Brandon Excel Worksheet Functions 3 April 26th 05 05:55 AM
Return to Current Sheet in On (sheet activate) event macro Paul Moles Excel Programming 1 March 27th 05 03:16 PM
Use current sheet name in Macro Bernie Deitrick Excel Programming 0 January 21st 04 04:48 PM


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