Saving and returning to saved screen view? (Pan L/R U/D)

  • Thread starter Thread starter Wandering Mage
  • Start date Start date
W

Wandering Mage

OK. So here's what I have. I click a cell, and a
selection change macro turns the cell value to "X" or ""
(toggles). Then it returns me to like range "B3", or
somewhere close to that. The problem is, part of where
this "X"ing macro is, may be far off to the right, and I
want the user to still be looking at where he clicked,
once the new value has been set to "X" or "", but I still
want the cell "B3" to be selected. Is there anyway to
save where the screen is panned over/up to before the
macro and then return it to that same view after? Help is
appreciated, as always! Thank you.
 
Try this. The first part stores the current cursor location (active cell),
your macro runs, then the last part takes you back to the stored location.
Is this what you need?

Dim cLoc As String
cLoc = ActiveCell.Address

'Your macro here that moves / scrolls the sheet to some other place

Application.Goto Reference:=Range(cLoc)


Cheers
Nigel
 
THANK YOU!
exactly what I was looking for.
-----Original Message-----
Try this. The first part stores the current cursor location (active cell),
your macro runs, then the last part takes you back to the stored location.
Is this what you need?

Dim cLoc As String
cLoc = ActiveCell.Address

'Your macro here that moves / scrolls the sheet to some other place

Application.Goto Reference:=Range(cLoc)


Cheers
Nigel





.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top