+ Reply to Thread
Results 1 to 4 of 4

Move a whole row from one sheet to next available row in another sheet based on cell value

  1. #1
    Registered User
    Join Date
    02-22-2018
    Location
    Newcastle, Australia
    MS-Off Ver
    Office 365
    Posts
    2

    Move a whole row from one sheet to next available row in another sheet based on cell value

    Hi, hoping someone can help me with this.

    I've got a spreadsheet that currently keeps track of all employees and their qualifications. It already has a macro running in the background to automatically chance cell colour based on the expiry date of their qualification.

    So far I've had all employees, past and current, on the same sheet, but now I want to create a second sheet for ex-employees, and have inserted a new column that asks if the employee is current with responses restricted to yes or no. I'd like the macro set up so that when 'no' is selected the whole row is automatically removed from that sheet and moved to the next available row on the ex-employee sheet. I want it set up so that this whole process happens without having to manually run the macro.

    The macro that was written to change the cell colour automatically was already in the spreadsheet when I was given it, and I found some code online to move rows from one sheet to another and have tried to adapt it into my workbook but it's not working the way I want it to. It inserts the rows from row 501 onwards, when the first available row in the second sheet should be row 3. It also doesn't run automatically - I have to manually run the macro before it'll work.

    These are the codes I'm running with:

    Sheet 1:
    Please Login or Register  to view this content.
    Module 2:
    Please Login or Register  to view this content.
    Any help would be greatly appreciated.

  2. #2
    Forum Expert JLGWhiz's Avatar
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    2,070

    Re: Move a whole row from one sheet to next available row in another sheet based on cell v

    See if this mod works
    Please Login or Register  to view this content.
    Any code provided by me should be tested on a copy or a mock up of your original data before applying it to the original. Some events in VBA cannot be reversed with the undo facility in Excel. If your original post is satisfied, please mark the thread as "Solved". To upload a file, see the banner at top of this page.
    Just when I think I am smart, I learn something new!

  3. #3
    Registered User
    Join Date
    02-22-2018
    Location
    Newcastle, Australia
    MS-Off Ver
    Office 365
    Posts
    2

    Re: Move a whole row from one sheet to next available row in another sheet based on cell v

    It sure does, thanks mate! Would there be a way I could get Excel to automatically arrange the rows alphabetically based on the data in call A?

  4. #4
    Forum Expert JLGWhiz's Avatar
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    2,070

    Re: Move a whole row from one sheet to next available row in another sheet based on cell v

    Please Login or Register  to view this content.
    this would be the basic sort method for the ex-employee sheet. You could probably work it into the other code after the For ... Next loop. Without the Sub, End Sub lines, of course.
    Last edited by JLGWhiz; 02-23-2018 at 12:22 PM.

+ 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] Move Row(s) To Another Sheet (One of Five) Based On One+ Cell Value
    By gothope? in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-22-2016, 07:23 AM
  2. [SOLVED] Move Row To a Particular Sheet Based on Cell Value
    By sliesneekr in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-02-2016, 12:16 PM
  3. [SOLVED] Move a row to another sheet in the same workbook based on the value of one cell
    By Philpot in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-09-2013, 07:00 AM
  4. VBA CODE to move rows from one sheet(1) to another sheet(2) based on data in cell
    By fozzieulo in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-08-2013, 02:43 PM
  5. Move row of data from one sheet to another based on cell value
    By Kaz09 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-09-2012, 09:48 AM
  6. Macro to move rows from one sheet to another sheet based on a cell vaule
    By d55272 in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 10-09-2012, 03:33 PM
  7. [SOLVED] Move datasets sheet to sheet based on list in different sheet
    By Hyflex in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 10-25-2011, 04:45 AM

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