+ Reply to Thread
Results 1 to 11 of 11

Delete all rows with #REF errors

  1. #1
    Forum Contributor
    Join Date
    08-06-2007
    Posts
    105

    Delete all rows with #REF errors

    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.

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    re: Delete all rows with #REF errors

    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.

  3. #3
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Delete all rows with #REF errors

    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

  4. #4
    Forum Contributor
    Join Date
    08-06-2007
    Posts
    105

    Re: Delete all rows with #REF errors

    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!

  5. #5
    Registered User
    Join Date
    06-26-2012
    Location
    Phoenix, Arizona
    MS-Off Ver
    Excel 2010
    Posts
    27

    Re: Delete all rows with #REF errors

    DonkeyOte,

    Thank you very much for this code!
    I'm using it everyday now.
    jnbroek

  6. #6
    Registered User
    Join Date
    03-01-2013
    Location
    vellore
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Delete all rows with #REF errors

    wats the use of deleting with error can u pls explain me iam a begginner

  7. #7
    Registered User
    Join Date
    06-26-2012
    Location
    Phoenix, Arizona
    MS-Off Ver
    Excel 2010
    Posts
    27

    Re: Delete all rows with #REF errors

    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.

  8. #8
    Registered User
    Join Date
    03-01-2013
    Location
    vellore
    MS-Off Ver
    Excel 2007
    Posts
    5

    Post Re: Delete all rows with #REF errors

    Quote Originally Posted by jnbroek View Post
    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.


    thanks for reply can u help how to learn excel as per my work iam working in chemical company as accountant in manual actually i need to learn excel and get my work easier! sme formulaes kind of useful formulaes etc i wanna to learn

  9. #9
    Registered User
    Join Date
    06-26-2012
    Location
    Phoenix, Arizona
    MS-Off Ver
    Excel 2010
    Posts
    27

    Re: Delete all rows with #REF errors

    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.

  10. #10
    Registered User
    Join Date
    03-01-2013
    Location
    vellore
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Delete all rows with #REF errors

    Quote Originally Posted by jnbroek View Post
    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.


    then can tell some tips how to learn excel as per my work more no issues in tat all i need is i wanna to learn excel

  11. #11
    Registered User
    Join Date
    03-01-2013
    Location
    vellore
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Delete all rows with #REF errors

    Quote Originally Posted by AJAY007007 View Post
    then can tell some tips how to learn excel as per my work more no issues in tat all i need is i wanna to learn excel
    wats the short for insert column row and how to add some details form sheet 1 sheet 2 to sheet 3 for example in sheet 1 have customer details and sheet to there outstandings how can i combine tis with formulaes

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1