Link to home
Start Free TrialLog in
Avatar of finnstone

asked on

vba errror

when i run the attached book for macro named deleterows2, i get an object not found end or rows error
Avatar of Yuval_Shohat
Flag of Israel image

if I understand your code correctly you are checking each line by regexp with the purpose of removing any line with unprintable characters.
The thing is that in this case the regexp found non so it never got to the section that sets d to something else than the original "nothing" value.
the If x.Test(c.Value) Then in this case is never true, so when it gets to the d.EntireRow.Delete, d = nothing and does not have any line value.

assuming your regex is done correctly, you should check d's value and if  d="nothing" then you should skip the delete or have something else.

Good luck.
Avatar of Rgonzo1971

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
No comment has been added to this question in more than 21 days, so it is now classified as abandoned.

I have recommended this question be closed as follows:

Accept: Rgonzo1971 (https:#a42449436)

If you feel this question should be closed differently, post an objection and the moderators will review all objections and close it as they feel fit. If no one objects, this question will be closed automatically the way described above.

Experts-Exchange Cleanup Volunteer