+ Reply to Thread
Results 1 to 6 of 6

Moving data to different sheets based on cell contents

  1. #1
    Registered User
    Join Date
    10-30-2013
    Location
    USA
    MS-Off Ver
    Excel 2013
    Posts
    10

    Moving data to different sheets based on cell contents

    Hope I'm not being a pain, but I need help one more time... a manager at my POE is trying to help one of her team work smarter, not harder. On the attached spreadsheet, you can see she's got it set up so that when the employee enters data in the front page, depending on the contents of the drop down in column "C", the data in the row gets moved to the appropriate worksheet. She's accomplishing this through IF statements. The issue is that it moves the data laterally, instead of putting it in the first available row in the appropriate worksheet. Is it possible to get the data to move to the first available row when it copies from the main sheet to the secondary sheet; and if so, how?

    You guys rock, btw... thanks so much for your help!


    PVC REQUESTS COPY .xlsx

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

    Re: Moving data to different sheets based on cell contents

    Hi

    This is easily done.

    In your example the data is not moved. It is copied. It that what you want?

    This can be done using an array formula but that is complicated and can use up a lot of memory and can be slow.

    I would do this using about three macros. That would be fast and efficient.

    Also what happens if you want to move the record again?


    I have created something to get you started.

    Have a play while I explain it.

    My solution uses 3 macros.

    The first is a workbook macro and runs whenever you change your selection in any sheet within the workbook.

    Its main function is to stop you selecting or changing row 1 of any sheet.

    It also stores the value if you select column C of "Kelly Tracking" this is so we can delete an existing entry, if you are re assigning an entry.

    Please Login or Register  to view this content.

    The second Macro is a sheet specific macro, all it does is check to see if you have changed a value in column C of "Kelly Tracking"
    and kicks of the main macro. "MoveEntry"

    Please Login or Register  to view this content.
    We need MoveEntry because sheet specific macros cannot modify any sheet other than its own sheet.

    Please Login or Register  to view this content.


    This is just my first pass.

    I wonder where you would enter your data?

    Is the Data entered into Kelly Tracking? if so you may change column C at the wrong time and move half your data.

    So maybe the data in column C may need to be moved to the last column.

    Or maybe we should only run MoveEntry when all the cells in the row are filled.

    I await your input.
    Attached Files Attached Files
    Last edited by mehmetcik; 01-21-2016 at 05:53 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
    Registered User
    Join Date
    10-30-2013
    Location
    USA
    MS-Off Ver
    Excel 2013
    Posts
    10

    Re: Moving data to different sheets based on cell contents

    Sorry, I misspoke. I'd like the data copied, so that it remains in the first tab, and also is copied to whichever tab is specified by the drop down box. The data will remain in both tabs; I don't think there will be a need to change the dropdown box once it's selected.

  4. #4
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,926

    Re: Moving data to different sheets based on cell contents

    Here's my entry into this contest. It makes extensive use of Excel Tables. The reason I used tables is because they expand to fit the data you have and copy formulas, etc. down automatically as you add rows. Also they are very "addressable." You work with column header names instead of column letters, so it's a lot more flexible and easier to write code and formulas for. To learn more about tables, see this article: http://www.utteraccess.com/wiki/inde...ables_in_Excel,

    I made one change to your headers: I made the Borrower Name consistent across tables. It made part of the code easier to implement.

    The heart of the coding is on the Configuration page. The table in Columns A:C I call "Table_Map" that tells the program where to put the information on the Kelly Page on whatever page it belongs. I didn't have enough information to map everything out, but you can do that and the code should work. There is a smaller table that maps the selected type to a page and table on the page.

    To enter a record, type it in the row under the table. It will be come part of the table. Make sure you select a cell in the record you want to post, then click on the post button. There are checks to see if you selected a good cell, and a check to see if on the selected page, that you are not trying to make a duplicate entry.
    Attached Files Attached Files
    Last edited by dflak; 01-21-2016 at 09:55 PM.

  5. #5
    Registered User
    Join Date
    10-30-2013
    Location
    USA
    MS-Off Ver
    Excel 2013
    Posts
    10

    Re: Moving data to different sheets based on cell contents

    I apologize... things picked up at work and I haven't been able to try this out... I want to say thanks, though, for the help... I'll hopefully be able to try it this week and let you know how it goes.

  6. #6
    Registered User
    Join Date
    10-30-2013
    Location
    USA
    MS-Off Ver
    Excel 2013
    Posts
    10

    Re: Moving data to different sheets based on cell contents

    My apologies for not getting back on this... due to staffing changes here, this will no longer be needed. Thanks to those who replied!

+ 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. Moving row to other sheets based on cell conten,t multiple arguements.
    By kittysmith in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-30-2015, 06:49 PM
  2. [SOLVED] Moving rows of data to multiple sheets based on status
    By sthiessen85 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 03-18-2015, 01:21 PM
  3. Moving Cell contents with a formula, based on the column value?
    By bvandervyver44 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-13-2013, 02:51 AM
  4. Moving data amongst sheets based on name
    By ball1132 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-18-2012, 02:22 PM
  5. Replies: 4
    Last Post: 09-15-2012, 02:18 PM
  6. Replies: 0
    Last Post: 05-21-2012, 06:59 AM
  7. Moving rows based on cell contents
    By WasWodge in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-31-2010, 11:27 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