We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

Debug Error for macro -deleting rows

ceneiqe
ceneiqe asked
on
Medium Priority
207 Views
Last Modified: 2012-06-22
Why is there an error at End If ?
Previously it was working fine to delete all the unwanted rows

Basically the wanted rows would be the first row of every line.
Any row without a content in column A will need to be deleted.

Error either found in
Rng.Item(ix).EntireRow.Delete

Or
      End If


See attached for example

Worksheet "MAR11 (t2)" is the initial worksheet
and "MAR11 (t2) (results) " is the desired final result . Macro-Test.xls
Comment
Watch Question

CERTIFIED EXPERT
Top Expert 2008
Commented:
Unlock this solution with a free trial preview.
(No credit card required)
Get Preview

Author

Commented:
thanks ! so what did i do wrong ?
still dun understand why the error occur.
CERTIFIED EXPERT
Top Expert 2008

Commented:
The first thing is that the used range is huge and that made the row by row deletion take a lot longer and probably caused the error. The second thing is that I do a final delete of all rows below the last occurring non-blank column A value in one statement.

Kevin
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a free trial preview!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.