Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 258
Default Set active sheet

How do you set the current worksheet as the activesheet so that when a
routine ends you are back to the worksheet you started in.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Set active sheet

You are best off not to select sheets as you go but that takes a bit of
understanding how the excel objects model works... A quick way would be to
add some code around your routine something like this...

Sub DoSomeStuff
dim wks as worksheet

set wks = activesheet
'Do your stuff here...

wks.select
set wks = nothing
end sub
--
HTH...

Jim Thomlinson


"Patrick Simonds" wrote:

How do you set the current worksheet as the activesheet so that when a
routine ends you are back to the worksheet you started in.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 258
Default Set active sheet

Thanks for your time and reply, but I already using "Dim SH As Worksheet"
so it would not allow me to use "dim wks as worksheet"


"Jim Thomlinson" wrote in message
...
You are best off not to select sheets as you go but that takes a bit of
understanding how the excel objects model works... A quick way would be to
add some code around your routine something like this...

Sub DoSomeStuff
dim wks as worksheet

set wks = activesheet
'Do your stuff here...

wks.select
set wks = nothing
end sub
--
HTH...

Jim Thomlinson


"Patrick Simonds" wrote:

How do you set the current worksheet as the activesheet so that when a
routine ends you are back to the worksheet you started in.





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
Copy sheet and make new sheet active belvy123 Excel Discussion (Misc queries) 5 April 24th 08 03:33 PM
Active Cell Copy And Paste Sheet to Sheet A.R.J Allan Jefferys New Users to Excel 4 May 4th 06 02:04 AM
How do i copy a active sheet to a new sheet with code and everything Karill Excel Programming 2 April 11th 06 06:22 PM
Copy my active sheet to a new sheet and open with an input form Brad Withrow Excel Programming 0 April 6th 06 03:56 AM
Copy from active sheet and paste into new sheet using info from cell in active Ingve Excel Programming 3 January 23rd 06 09:57 PM


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