View Single Post
  #9   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default retain Selection

If you're changing workbooks and or worksheets, you'll have to activate those
first.

savesel.parent.parent.activate 'activate the workbook
savesel.parent.select 'select the worksheet
savesel.select 'select the range

or you could use:

application.goto savesel, scroll:=true 'or false???



DrFear wrote:

I'm trying to restore the Selection that was in place at the time I started a
routine that changes the selection during its run. In other words I want
something like

dim saveSel as Range
Set saveSel = Application.Selection

... do stuff that destroys the current selection then

saveSel.Select

And the problem with this is of course that the object to which saveSel
refers has been destroyed in the meantime. What I actually want is to have
saveSel be a range (or ref to a range) of cells that is set to whatever was
selected originally.

Any ideas?


--

Dave Peterson