Undesirable sorting behavior

M

Map Man

Not really a development question, but I was writing a macro that does a bunch of sorting, and I was wondering if there is a setting or a way to prevent Excel from jumping to the top of the sheet every time I do a sort? It's rather annoying.
 
A

Auric__

Map said:
Not really a development question, but I was writing a macro that does a
bunch of sorting, and I was wondering if there is a setting or a way to
prevent Excel from jumping to the top of the sheet every time I do a
sort? It's rather annoying.

Not that I know of, but you could just move the view back to where it was:

vrow = ActiveWindow.VisibleRange.Row
vcol = ActiveWindow.VisibleRange.Column
'your sorting code here, then...
rowdif = vrow - ActiveWindow.VisibleRange.Row
coldif = vcol - ActiveWindow.VisibleRange.Column
ActiveWindow.SmallScroll Down:=rowdif, ToRight:=coldif
 

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

Top