J
JSnow
I'm using Excel 2003 and sorting rows by one of eight different column
headings. I've placed a transparent shape over each heading and assigned one
of the eight different sort macros to each corresponding column. Columns B,
C, D, H, I, and J work just fine. Columns K and L are giving me strange
output. Here's the macro for column K "FIN IMPACT":
Sub sortImpact()
ActiveSheet.Unprotect
Dim strSrt As Long
strSrt = MsgBox("Do you want to sort your policies by FINANCIAL
IMPACT?", 4 + 32, "Sort Table")
If strSrt = vbYes Then
Range("B2:L101").Sort Key1:=Range("K2"), Order1:=xlDescending, Header:= _
xlGuess, OrderCustom:=1, MatchCase:=False,
Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
End If
ActiveSheet.Protect
End Sub
Instead of listing the data from most expensive to least expensive starting
w/ row 2, the data sorts in the correct order but lists ending on row 101.
For example: if I have two rows, I expect the data to sort on rows 2 & 3.
Instead it sorts on rows 100 & 101 (the last two rows). The only columns
that sort like this are K & L. The only difference between these macros and
others, which work normally, is the sort key range.
headings. I've placed a transparent shape over each heading and assigned one
of the eight different sort macros to each corresponding column. Columns B,
C, D, H, I, and J work just fine. Columns K and L are giving me strange
output. Here's the macro for column K "FIN IMPACT":
Sub sortImpact()
ActiveSheet.Unprotect
Dim strSrt As Long
strSrt = MsgBox("Do you want to sort your policies by FINANCIAL
IMPACT?", 4 + 32, "Sort Table")
If strSrt = vbYes Then
Range("B2:L101").Sort Key1:=Range("K2"), Order1:=xlDescending, Header:= _
xlGuess, OrderCustom:=1, MatchCase:=False,
Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
End If
ActiveSheet.Protect
End Sub
Instead of listing the data from most expensive to least expensive starting
w/ row 2, the data sorts in the correct order but lists ending on row 101.
For example: if I have two rows, I expect the data to sort on rows 2 & 3.
Instead it sorts on rows 100 & 101 (the last two rows). The only columns
that sort like this are K & L. The only difference between these macros and
others, which work normally, is the sort key range.