-
Runtime Error 438
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
-
Hi & welcome to the board.
Change Add2 to Add both times it appears.
-
Working perfectly thank you
-
You're welcome & thanks for the feedback
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules