+ Reply to Thread
Results 1 to 8 of 8

Delete row and move information up for current month and each month after

  1. #1
    Forum Contributor
    Join Date
    10-06-2015
    Location
    USA
    MS-Off Ver
    MS office 2010
    Posts
    123

    Delete row and move information up for current month and each month after

    I have a spreadsheet where I have information in each month. When I click the cell with the name and hit the delete button it deletes the name in that month, moves everything up, but not for the months after. the months after it gives me a #ref error. Is there a way to delete information in one month excel will automatically delete the inforimation in that month and the months after it moving the information up so there is not a blank row? see attached.
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    05-08-2015
    Location
    Uvalde, TX
    MS-Off Ver
    2010
    Posts
    720

    Re: Delete row and move information up for current month and each month after

    Here is a macro that you can use to delete all rows that have #REF! in Column D.

    Please Login or Register  to view this content.
    As for making it automatic, it will take a real guru to figure out how to work it into a "Worksheet_SelectionChange".

    Hope this is helpful.

  3. #3
    Forum Contributor
    Join Date
    10-06-2015
    Location
    USA
    MS-Off Ver
    MS office 2010
    Posts
    123

    Re: Delete row and move information up for current month and each month after

    I have this working on each tab already. I just need to figure out how to get rid of the REF for the tabs after if they are there, even if they are left blank.

  4. #4
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Delete row and move information up for current month and each month after

    Why have a tab setup like you for each month and why delete the monthly data? You have over 1 million rows. Take advantage of them. Just add a date column to your data and use the filtering available in Excel to hide the months that you don't want to see. You will not be receiving #Ref errors that are due to the reference no longer existing and you will be able to produce reports that cover a period of time greater than 1 month.

    Doing the above, you will no longer have need of macros and you will have a history of your data.
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  5. #5
    Forum Contributor
    Join Date
    10-06-2015
    Location
    USA
    MS-Off Ver
    MS office 2010
    Posts
    123

    Re: Delete row and move information up for current month and each month after

    I would do that but where I work I need to make it simple for the staff. It is not easy for most to figure that out. It is easy for you and I but some will make things difficult.

  6. #6
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Delete row and move information up for current month and each month after

    Educate them! It isn't rocket science.

  7. #7
    Valued Forum Contributor
    Join Date
    01-03-2016
    Location
    Conwy, Wales
    MS-Off Ver
    2016
    Posts
    974

    Re: Delete row and move information up for current month and each month after

    @ferriskenny Open up the attached workbook. Put cursor in any row in any sheet and click on the "Delete Row" button (or just run the macro)

    The macro has been written in a slightly long-winded way so that it is clearer to understand what is going on.

    What the macro does
    Deletes details for a single patient in active sheet and in FUTURE months
    (I assume that you do not want to delete prior months details)

    How it does it
    - asks for confirmation that user has his selection correct
    - uses the "Match" function to find future records for that patient
    (all patient names must be unique)
    - updates arrays to capture sheet and row numbers
    - provides feedback to user of future records found
    - asks user to confirm deletion request
    - loops through arrays and deletes required rows

    Hope this gets you close - if it does, then we can build a simple "checker" for non uniques patient names.

    Please Login or Register  to view this content.
    Attached Files Attached Files
    If a response has helped then please consider rating it by clicking on *Add Reputation below the post
    When your issue has been resolved don't forget to mark the thread SOLVED (click Thread Tools at top of thread)

  8. #8
    Forum Contributor
    Join Date
    10-06-2015
    Location
    USA
    MS-Off Ver
    MS office 2010
    Posts
    123

    Re: Delete row and move information up for current month and each month after

    This works perfect. If I create a index in a new tab so the name cannot be accidentally be deleted by hitting a space button or a different letter, I keep getting a debug error because the name cells are locked. How would I fix?

+ 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. Replies: 1
    Last Post: 04-29-2016, 01:28 PM
  2. [SOLVED] Macro to cut and paste current month sheet into the relevant month chosen by a drop down
    By scotty22 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-06-2015, 09:07 AM
  3. [SOLVED] Determine work days in current month or next month based on day of the month
    By sbrnard in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 05-29-2014, 05:14 PM
  4. [SOLVED] Pick a cell containing current month actulas based what the current month is.
    By vanbasten007 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-10-2014, 01:17 AM
  5. Copy current month and delete entrys in 2 columns and move entrys in 2 columns
    By temar in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-18-2013, 09:54 PM
  6. Macro using vlookups comparing 2 months paysheet(previous month and current month)
    By srinivasan1965 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-07-2012, 03:45 AM
  7. Delete current month using AUTOFILTER
    By Mslady in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-03-2005, 03:25 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