+ Reply to Thread
Results 1 to 6 of 6

Delete #REF rows and move rows up if it's on the first line

  1. #1
    Registered User
    Join Date
    12-10-2014
    Location
    Chicago, IL
    MS-Off Ver
    Microsoft? Excel? for Microsoft 365 MSO (Version 2205 Build 16.0.15225.20368) 64-bit
    Posts
    96

    Delete #REF rows and move rows up if it's on the first line

    Hello,

    I have a basketball season data workbook that I am working on and I am looking on the main page to remove rows that contain a #REF! value in the cell. However, I am looking for it to do that if a #REF! cell appears on the same row and the name of the player that I would like to clear the cell and move up the first available non-#REF! row next to the players name.

    I have attached my workbook and an example of what I am trying to do is look at Matt Wenstrom on the 1993-94 Stats worksheet.

    If someone can help me out with this so I don't have to manually go through and remove that would be great. Thanks in advance for your help.
    Attached Files Attached Files

  2. #2
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,481

    Re: Delete #REF rows and move rows up if it's on the first line

    Hi there,

    See if the attached workbook does what you need.

    It uses the following code:

    Please Login or Register  to view this content.
    The highlighted values may be changed to suit your own requirements.


    Hope this helps - please let me know how you get on.

    Regards,

    Greg M
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    12-10-2014
    Location
    Chicago, IL
    MS-Off Ver
    Microsoft? Excel? for Microsoft 365 MSO (Version 2205 Build 16.0.15225.20368) 64-bit
    Posts
    96

    Re: Delete #REF rows and move rows up if it's on the first line

    This is great. The only thing that I see is that it removes the Total row as well if there is a #REF! value anywhere in the row. I should've mentioned that but if possible I would like the Total row to stay regardless if there is a #REF! value or not. I don't know if it's possible but if so could you let me know how that would be done? If not it's no big deal. I really do appreciate your help with this.

  4. #4
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,481

    Re: Delete #REF rows and move rows up if it's on the first line

    Hi again,

    Oops - I should have spotted that myself - sorry!

    See if the attached workbook does what you need.

    The code has been modified as follows to prevent deletion of the Totals rows:

    Please Login or Register  to view this content.
    The highlighted values can be changed to suit your own requirements.


    Hope this helps - as before, please let me know how you get on.

    Regards,

    Greg M
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    12-10-2014
    Location
    Chicago, IL
    MS-Off Ver
    Microsoft? Excel? for Microsoft 365 MSO (Version 2205 Build 16.0.15225.20368) 64-bit
    Posts
    96

    Re: Delete #REF rows and move rows up if it's on the first line

    This is perfect! Thanks again for all of your help!!

  6. #6
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,481

    Re: Delete #REF rows and move rows up if it's on the first line

    Hi again,

    Many thanks for your very prompt feedback and also for the Reputation increase - much appreciated!

    You're very welcome - glad I was able to help.

    Best regards,

    Greg M

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Delete Rows and move up.
    By moonbreakker in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-15-2015, 02:46 PM
  2. VBA to move and delete rows
    By thewiseguy in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 02-08-2015, 04:52 PM
  3. [SOLVED] Move data on duplicate rows (different columns) to one row and delete extra rows?
    By Sagwa in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-01-2014, 08:25 AM
  4. Move Rows to next available line in new worksheet
    By littleliz02 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-17-2013, 03:56 PM
  5. take extra columns of rows and move to new line
    By rampart551 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-20-2011, 10:01 PM
  6. Move and delete rows
    By Ross86 in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 09-22-2009, 09:20 AM
  7. Delete/Move rows
    By ganjo in forum Excel General
    Replies: 9
    Last Post: 01-12-2007, 05:16 PM

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