+ Reply to Thread
Results 1 to 6 of 6

Move Row To a Particular Sheet Based on Cell Value

  1. #1
    Registered User
    Join Date
    03-14-2014
    Location
    Missouri
    MS-Off Ver
    Excel 2003
    Posts
    13

    Move Row To a Particular Sheet Based on Cell Value

    I have created a simple inventory of my DVD's and Cd's. Three sheets in my workbook, At Home, Loaned Out and On Hold. Column C, in each sheet, which is named Status has a dropdown list with three choices, happen to also be At Home, Loaned out and On Hold. What I am after is when I choose the dropdown list I would like that row to be moved to the corresponding sheet. My current VBA will move the row from At Home sheet to Loaned out, can't figure out how to get them to move back and forth. This is the code that is attached to the At Home sheet, when I put this on the Loaned Out sheet and change it accordingly it doesn't work. Any Suggestions?

    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Move Row To a Particular Sheet Based on Cell Value

    Ok so you want a macro to work on three sheets.

    so why would you use a sheet specific macro?

    You should be using a workbook module.

    Open Visual Basic select view and then project explorer

    Find your project and double click on the This Workbook icon

    Paste this code there. It will work correctly on all three sheets.

    Please Login or Register  to view this content.
    Last edited by mehmetcik; 03-30-2016 at 12:16 PM.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

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

    Re: Move Row To a Particular Sheet Based on Cell Value

    Hi there,

    See if the attached workbook does what you need - it uses the following code:

    ThisWorkbook VBA CodeModule:

    Please Login or Register  to view this content.

    Standard VBA CodeModule:

    Please Login or Register  to view this content.
    I've modified things a little in that the dropdown list in each worksheet shows only the names of the two other worksheets - i.e. you don't have the option of transferring a data record from one worksheet to the same worksheet.

    Also, the data records in the source and target worksheets are sorted by Album Name after each transfer operation.


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

    Regards,

    Greg M
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    03-14-2014
    Location
    Missouri
    MS-Off Ver
    Excel 2003
    Posts
    13

    Re: Move Row To a Particular Sheet Based on Cell Value

    Wow, that is to the point and works great, thank you, very much appreciated!

  5. #5
    Registered User
    Join Date
    03-14-2014
    Location
    Missouri
    MS-Off Ver
    Excel 2003
    Posts
    13

    Re: Move Row To a Particular Sheet Based on Cell Value

    Thanks Greg M., that is awesome work. I thank you for taking the time to code it but mostly I appreciate the time you took to explain how each line works. I'm slowly learning the language and it helps when I can follow the process in my head, it allows me to use all or pieces of the code later in other work. Thanks again, it worked perfectly!

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

    Re: Move Row To a Particular Sheet Based on Cell Value

    Hi again,

    Many thanks for your feedback, for taking the trouble to thank me not once, but twice, and also for the Reputation increase - much appreciated

    I'm very pleased that you found my post so useful.

    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] VBA; Move row based on cell value to another sheet on same number of row.
    By Nirupay Robi in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-13-2015, 07:48 AM
  2. [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
  3. [SOLVED] Move entire row from one sheet to another based on cell value.
    By romanm in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-29-2013, 06:20 PM
  4. Move entire row to a new sheet based on cell value vba help
    By almasdour in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-15-2013, 01:38 PM
  5. 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
  6. 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
  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