|
![]() |
Topic Starter |
MVP
Join Date: Aug 2000
Location: Lee's Summit
Casino cash: $4711637
|
Excel VBA Guru's help needed.
I'm getting a debug error in this code: At th e End with statement. I hit continue and it continues and processes the next section but the debug error is killing me.
Basicallym I'm trying to sort 2 different sets of columns inside the same actice sheet. Sub SortBEandGJ() ' ' Macro1 Macro ' ' Keyboard Shortcut: Ctrl+n ' Columns("B:E").Select ActiveWorkbook.ActiveSheet.Sort.SortFields.Clear ActiveWorkbook.ActiveSheet.Sort.SortFields.Add Key:=Range("B2:B100"), _ SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:=xlSortNormal With ActiveWorkbook.ActiveSheet.Sort .SetRange Range("B1:E100") .Header = xlYes .MatchCase = False .Orientation = xlTopToBottom .SortMethod = xlPinYin .Apply End With Columns("G:J").Select ActiveWorkbook.ActiveSheet.Sort.SortFields.Clear ActiveWorkbook.ActiveSheet.Sort.SortFields.Add Key:=Range("G2:G100"), _ SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:=xlSortNormal With ActiveWorkbook.ActiveSheet.Sort .SetRange Range("G1:J100") .Header = xlYes .MatchCase = False .Orientation = xlTopToBottom .SortMethod = xlPinYin .Apply End With Range("A2").Select End Sub |
Posts: 8,290
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
![]() |
|
|