View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Norman Jones[_2_] Norman Jones[_2_] is offline
external usenet poster
 
Posts: 421
Default How to return to worksheet where macro started?

Hi Bob,

As already indicated by Rick, it is rarely
necessary, or efficient to select objects;
normally it is preferable to manipulate
relevant object variables.

That said, one approach might be:

'=========
Public Sub Tester()
Dim rngOriginal As Range
Dim rCellOriginal As Range

Set rngOriginal = Selection
Set rCellOriginal = ActiveCell

' Your code

Application.Goto rngOriginal
rCellOriginal.Activate
End Sub
'<<=========



---
Regards.
Norman


"Bob Arnett" wrote in message
...
I have a macro that turns off screen updating and then proceeds to jump
around to different worksheets to copy/paste/change some cells. At the end
of
this macro process, before I turn screen updating back on, I want to
return
to the cell/worksheet that I was on when I started started the macro
running.
This is not always the same cell/worksheet and I can't seem to find how
one
would do this. Any suggestions?