LearningEX
Board Regular
- Joined
- Mar 13, 2015
- Messages
- 208
Hi all
i keep getting this error and when i run F8 it skips this part of the code and goes straight to error
and this is the whole code
Can anyone help please
i keep getting this error and when i run F8 it skips this part of the code and goes straight to error
Code:
.Range("s9:s10000").Sort Key1:=.Range("s9"), Order1:=xlAscending, Header:=xlNoEnd With
'reset error
On Error GoTo 0
Exit Sub
'if error occurs then show me exactly where the error occurs
Sortit_Error:
and this is the whole code
Code:
Sub Sortit_123()'error handler
On Error GoTo Sortit_Error
'sort the phone list
With Sheet7
.Range("B9:r10000").Sort Key1:=.Range("r9"), Order1:=xlAscending, Header:=xlNo
'sort the index numbers
.Range("s9:s10000").Sort Key1:=.Range("s9"), Order1:=xlAscending, Header:=xlNo
End With
'reset error
On Error GoTo 0
Exit Sub
'if error occurs then show me exactly where the error occurs
Sortit_Error:
MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure Sortit of Module Sortit_123"
End Sub
Can anyone help please