+ Reply to Thread
Results 1 to 2 of 2

Move (cut and paste) multiple rows based on value in column B

  1. #1
    Registered User
    Join Date
    04-02-2023
    Location
    Cairns, Australia
    MS-Off Ver
    Microsoft 365 MSO (Version 2202 Build 16.0.14931.20272) 64-bit
    Posts
    11

    Move (cut and paste) multiple rows based on value in column B

    Hi team,

    I have a spreadsheet that calculates budgets and organises projects as Tasks and Subtasks. It already has a range of functions that involve buttons and VBA code to add data, delete rows, etc. But I'm now stumped as I've been asked to make it move multiple rows together up and down.
    I have attached the spreadsheet. It is a series of Tasks with a bunch of Subtasks within each task. Each task (including subtasks) comprises anything from 14 to 30 rows, and there might be up to 50 tasks. The user should be able to select a cell inside a task, and click to move that whole task (including subtasks) up and down.
    All the rows associated with a task are numbered in column B.

    So I think I need it to do this:
    - Go to Column B of activecell
    - Check what number is there (taskno)
    - Go up and find the first row that has that same taskno (taskfirstrow)
    - Go down and find the last row that has that same taskno (tasklastrow)
    - Select and Cut the entirerows of the range taskfirstrow to tasklastrow
    - IF MOVING UP: Go up to find the the first row that has the previous task number (taskno - 1). Paste before that row.
    - IF MOVING DOWN: Go down to find the the last row that has the next task number (taskno + 1). Go one more row down. Paste before that row.

    Any ideas?!

  2. #2
    Forum Contributor
    Join Date
    11-23-2022
    Location
    Amsterdam
    MS-Off Ver
    2021
    Posts
    193

    Re: Move (cut and paste) multiple rows based on value in column B

    Based on what is it decided that data have to be moved up or down?

+ 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] How to move rows based on cell value to multiple tabs?
    By AccountingJ in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 08-17-2020, 03:58 PM
  2. [SOLVED] VBA Change Event, Move multiple rows based on drop down selection for multiple criteria
    By Webbers in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-02-2017, 11:51 AM
  3. [SOLVED] Move Data from one column to multiple Rows
    By cmietzner in forum Excel Charting & Pivots
    Replies: 7
    Last Post: 11-28-2016, 07:12 PM
  4. [SOLVED] Event macro to move rows based on Column
    By onbeillp111 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-24-2013, 01:37 PM
  5. HELP: Move values from column to rows based on Column A
    By ExceJunkie in forum Excel General
    Replies: 2
    Last Post: 05-30-2013, 08:09 AM
  6. Replies: 1
    Last Post: 03-17-2013, 06:52 AM
  7. Move rows to another sheet based on column input
    By lacerz in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-01-2010, 01:02 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