View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Patrick Simonds Patrick Simonds is offline
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.