rama4672
09-06-2004, 10:58 AM
I have the following code, what i need it to do is when it gets to the message box i want it to display in the box the value of the range a2:k5
it goes through everthing ok untill it gets to the msgbox that is where i get the error.
Option Explicit
Sub sortorder()
' sortorder Macro
Dim temp As range
Set temp = ActiveSheet.range("a2:k5")
range("B1:K201").Select
Selection.AutoFilter
Selection.Sort Key1:=range("K1"), Order1:=xlDescending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
MsgBox (temp)
Selection.Sort Key1:=range("B1"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Selection.AutoFilter
range("B2").Select
End Sub
Thank you if anyone can help
Ian
it goes through everthing ok untill it gets to the msgbox that is where i get the error.
Option Explicit
Sub sortorder()
' sortorder Macro
Dim temp As range
Set temp = ActiveSheet.range("a2:k5")
range("B1:K201").Select
Selection.AutoFilter
Selection.Sort Key1:=range("K1"), Order1:=xlDescending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
MsgBox (temp)
Selection.Sort Key1:=range("B1"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Selection.AutoFilter
range("B2").Select
End Sub
Thank you if anyone can help
Ian