How can I have VBA delete all rows with a #REF! error?
I was trying to use this code but it doesn't work (which i think is obvious why) but I don't know what variable to enter instead?
Please Login or Register to view this content.
How can I have VBA delete all rows with a #REF! error?
I was trying to use this code but it doesn't work (which i think is obvious why) but I don't know what variable to enter instead?
Please Login or Register to view this content.
Last edited by adgjqetuo; 09-30-2009 at 11:07 AM.
Are there any other errors in that range ?
If not and we assume the cells contain formulae (not pasted results as values) then:
Please Login or Register to view this content.
My Recommended Reading:
Volatility
Sumproduct & Arrays
Pivot Intro
Email from XL - VBA & Outlook VBA
Function Dictionary & Function Translations
Dynamic Named Ranges
Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution. Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.
To change a Title on your post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.
Title edited to remove unnecessary wording
Hope that helps.
RoyUK
--------
For Excel Tips & Solutions, free examples and tutorials why not check out my web site
Free DataBaseForm example
I'm sorry I did not mean to violate the rules - however I don't understand how my title isn't accurate? I was looking for a code that deletes all rows with #REF errors - and thats what the title says?
DonkeyOte: Thank you, that worked perfectly - not sure why I didn't think of that earlier!
DonkeyOte,
Thank you very much for this code!
I'm using it everyday now.
jnbroek
wats the use of deleting with error can u pls explain me iam a begginner
The worksheet with this new code has cells that are linked to data from other worksheets in the same workbook. Sometimes the data gets deleted in one of the worksheets and new values are entered in the same cells. When this happens, errors occur in the cells that had the old values and no longer serve any purpose. Because the worksheet with the new code gets sorted every time it is activated, the rows with the errors end up at the back end of the range I have set up in this worksheet. The rows with these errors can then be taken out without any effect on the data I need. I wanted them deleted so they do not take up extra space.
Not sure if this makes any sense but it sure works well for me.
I can assure you that I am not the guy you want to train you! I'm still learning Excel... maybe know half the stuff that can be done with Excel 2010 but that's just an optimistic guess on my part. I never had any training in Excel. Just picked it up in bits and pieces. Will be taking a formal class soon to make it easier to understand how things work.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks