dcondillac
12-16-2019, 05:35 AM
I have created a VBA script that works perfectly fine on my system, but when i run it on my colleagues system it starts working but stops at the point highlighted in bold below. the error is 438.
Range("A10:H13000").Select
ActiveWorkbook.Worksheets("PASSPORT_BANK").SORT.SortFields.Clear
ActiveWorkbook.Worksheets("PASSPORT_BANK").SORT.SortFields.Add2 Key:=Range( _
"D10: D12609"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _
xlSortNormal
ActiveWorkbook.Worksheets("PASSPORT_BANK").SORT.SortFields.Add2 Key:=Range( _
"B10:B12609"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _
xlSortNormal
With ActiveWorkbook.Worksheets("PASSPORT_BANK").SORT
.SetRange Range("A9:H12609")
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Range("A10:H13000").Select
ActiveWorkbook.Worksheets("PASSPORT_BANK").SORT.SortFields.Clear
ActiveWorkbook.Worksheets("PASSPORT_BANK").SORT.SortFields.Add2 Key:=Range( _
"D10: D12609"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _
xlSortNormal
ActiveWorkbook.Worksheets("PASSPORT_BANK").SORT.SortFields.Add2 Key:=Range( _
"B10:B12609"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _
xlSortNormal
With ActiveWorkbook.Worksheets("PASSPORT_BANK").SORT
.SetRange Range("A9:H12609")
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With