+ Reply to Thread
Results 1 to 5 of 5

VBA to Move Row in a Sheet Based on Cell Value

  1. #1
    Registered User
    Join Date
    08-08-2016
    Location
    England
    MS-Off Ver
    2021
    Posts
    7

    Question VBA to Move Row in a Sheet Based on Cell Value

    Ok so previously someone on this forum found me a solution for this, but after making some changes to the spreadsheet, there appears to be further issues.

    I want the VBA to do the following:

    If for example the data in cell B10 on the tab 'TSP Milestone Tracker' reads 'Complete', the entire line (B10:L10) is to be moved (not copied), to another sheet named 'TSP Completed Milestones' and inserted into the B10:L10 location.

    Following this, each further line of data marked 'complete' on 'TSP Milestone Tracker', needs then to be moved to the next available line on the 'TSP Completed Milestones' sheet below the previous line of data and all other lines on 'TSP Milestone Tracker' moved up to fill the gap.

    I would also like to be able to add further lines to the data beyond line 179 on 'TSP Milestone Tracker' so the function must be flexible to allow this.

    Hopefully this makes sense? The file has been attached.

    If you need any further info. I can clarify.

    Thanks in advance.
    Attached Files Attached Files
    Last edited by samjbeattie; 05-31-2020 at 05:51 AM. Reason: Solved

  2. #2
    Valued Forum Contributor
    Join Date
    06-22-2018
    Location
    Blackpool, England
    MS-Off Ver
    2019
    Posts
    408

    Re: VBA to Move Row in a Sheet Based on Cell Value

    Not given this much thought, but you may be better converting the destination worksheet area to a table, then it'll auto-expand with new data without specific code to do it. You could also do the same on the "Tracker" worksheet.

    Anayway, after adding "Completed" to the list of permissible entries in column "B", then try this:
    Please Login or Register  to view this content.
    Just another thought: it may be better, though, to put the "status" column on the far right of that data area - then inputting the data will be more intuitive. Users start from the left, fill in the data and then mark it "complete". Otherwise they have to start on the left, omit column "B", complete the data input and then go back to column "B" to finish off.

    Does that do it for you?

    Tim
    Never stop learning!
    <--- please consider *-ing !

  3. #3
    Registered User
    Join Date
    08-08-2016
    Location
    England
    MS-Off Ver
    2021
    Posts
    7

    Re: VBA to Move Row in a Sheet Based on Cell Value

    Works perfectly.

    Also thanks for the tips, will make some amendments.

    Thank you.

  4. #4
    Valued Forum Contributor
    Join Date
    06-22-2018
    Location
    Blackpool, England
    MS-Off Ver
    2019
    Posts
    408

    Re: VBA to Move Row in a Sheet Based on Cell Value

    You're quite welcome, and thanks for the rep.

    Tim

  5. #5
    Registered User
    Join Date
    06-08-2020
    Location
    Norway
    MS-Off Ver
    365
    Posts
    2

    Re: VBA to Move Row in a Sheet Based on Cell Value

    Okey i have a question,

    I would like to move a row from one, to another table if a cell value goes from 1 to 0.

    Have been trying to write a code but not succeeded.. appreciate any tips!

+ 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. VBA to Move Row in a Sheet Based on Cell Value
    By samjbeattie in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-07-2020, 02:06 PM
  2. move row to another sheet based on cell value
    By chelsy in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-19-2019, 05:59 PM
  3. [SOLVED] Move row to another sheet based on cell value
    By M5B in forum Excel Programming / VBA / Macros
    Replies: 21
    Last Post: 12-14-2018, 05:37 PM
  4. [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
  5. [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
  6. 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
  7. 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

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