Thread: Unselect range
View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Unselect range

Sub Macro2()

Application.ScreenUpdating = False
With Sheets("Sheet3")
.Columns("A:B").Sort Key1:=.Range("B1"), _
Order1:=xlAscending, Header:=xlYes, _
OrderCustom:=1, MatchCase:=False, _
Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
End With
Application.ScreenUpdating = True

End Sub

--
Regards,
Tom Ogilvy


"Biff" wrote in message
...
Hi folks!

I have this simple macro created using the recorder:

Sub Macro2()

Application.ScreenUpdating = False
Sheets("Sheet3").Select
Columns("A:B").Select
Selection.Sort Key1:=Range("B1"), Order1:=xlAscending,

Header:=xlGuess,
_
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Sheets("Sheet2").Select
Application.ScreenUpdating = True

End Sub

All it does is sort Sheet3 A:B

I have the macro assigned to a button on another sheet. It works fine

except
that after it runs and I go to sheet3 the sorted range, columns A:B, are
still selected.

How can I get the sorted range to be unselected after the macro runs?

Thanks!

Biff