Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Copy sheet and make new sheet active | Excel Discussion (Misc queries) | |||
Active Cell Copy And Paste Sheet to Sheet | New Users to Excel | |||
How do i copy a active sheet to a new sheet with code and everything | Excel Programming | |||
Copy my active sheet to a new sheet and open with an input form | Excel Programming | |||
Copy from active sheet and paste into new sheet using info from cell in active | Excel Programming |