Link to home
Start Free TrialLog in
Avatar of Euro5
Euro5Flag for United States of America

asked on

VBA macro to remove rows not working

In the attached,

Net Rate Sheet 2.DeleteThem should remove anything on Net Rate sheet 2 between the service name and the phrases
                If .Cells(lngend, 1) = "Please refer to list rates for this service." Or _
                   .Cells(lngend, 1) = "Net Rates are not available for these services" Then

However, it is not working for the service "Domestic First Overnight Non-Freight"

Can someone help?
deletethemissue.xlsm
ASKER CERTIFIED SOLUTION
Avatar of Martin Liss
Martin Liss
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Euro5

ASKER

Yes, you are right about the duplicate - I was trying to see if there was a variance in the phrase that I wasn't catching.

What it used to do was:
1. look for phrase - example ""Domestic First Overnight Non-Freight"
2. look for phrase either "Please refer to list rates..." or "Net Rates are not available..."
3. if that phrase was below, it would remove everything from the first phrase to the last

In these instances there would NOT be a rate table between the two phrases.
I know this used to work this way....    can you help?
Avatar of Euro5

ASKER

I removed duplicate and used a trim. Working perfectly again. Thanks!
You're welcome.