View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Auric__ Auric__ is offline
external usenet poster
 
Posts: 538
Default Undesirable sorting behavior

Map Man wrote:

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

--
Were that all people were of as true of purpose as yourself.