Link to home
Create AccountLog in
Avatar of Peter Chan
Peter ChanFlag for Hong Kong

asked on

Macro issue

Hi,
Can you help due to error "Subscript out of range" when running macro of attached file?ErrorFilter.xlsm
Avatar of Bill Prew
Bill Prew

Try this small change:

    On Error Resume Next
    Sheets("Output").Delete
    On Error GoTo 0

Open in new window


»bp
ASKER CERTIFIED SOLUTION
Avatar of Saqib Husain
Saqib Husain
Flag of Pakistan image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
You would also have to change

        If Mid(Item0, "-") > 0 Then

to

        If InStr(Item0, "-") > 0 Then


Your code should be in a Standard Module.

I see no reason to actually delete the sheet and replace when you can simply clean up th e existing sheet.

Also, I've added a Function to save looping to check if the sheet exists.
ErrorFilter.xlsm