+ Reply to Thread
Results 1 to 11 of 11

VBA code to automatically transfer data from one sheet to another based on dropdown

  1. #1
    Registered User
    Join Date
    08-20-2013
    Location
    São Paulo, Brazil
    MS-Off Ver
    Excel 2003
    Posts
    6

    VBA code to automatically transfer data from one sheet to another based on dropdown

    Hello,

    I need a VBA code that will cut a row in one worksheet called "MKT" and transfer it to the worksheet called "Completed" based on me selecting "YES" from a dropdown menu. I have attached the file so you can get an idea.

    Once the data is transferred from "MKT", I would like the row to be deleted.

    Once on the "Completed" worksheet, I would also like to know which worksheet the information is coming from, because I will apply this formula to all the worksheets in the book, "MKT", "Business Model", "Product" and "People".

    Thanks!

  2. #2
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: VBA code to automatically transfer data from one sheet to another based on dropdown

    I need a VBA code that will cut a row in one worksheet called "MKT" and transfer it to the worksheet called "Completed"
    Once on the "Completed" worksheet, I would also like to know which worksheet the information is coming from
    Won't it always be coming from the MKT worksheet?

    Also, if you have merged cells, you're not going to be able to delete the entire row, because its only half of a cell.
    Last edited by Solus Rankin; 08-21-2013 at 11:32 AM.
    Thanks,
    Solus


    Please remember the following:

    1. Use [code] code tags [/code]. It keeps posts clean, easy-to-read, and maintains VBA formatting.
    Highlight the code in your post and press the # button in the toolbar.
    2. Show appreciation to those who have helped you by clicking below their posts.
    3. If you are happy with a solution to your problem, mark the thread as [SOLVED] using the tools at the top.

    "Slow is smooth, smooth is fast."

  3. #3
    Registered User
    Join Date
    08-20-2013
    Location
    São Paulo, Brazil
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: VBA code to automatically transfer data from one sheet to another based on dropdown

    Well, I have three other tabs that I wanted to apply a similar code to that will populate the same "completed" tab.

    Cutting the information off the primary tab will suffice. I just don't want it to continue there once the data is transferred.

    Any suggestions?

    Thanks

  4. #4
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: VBA code to automatically transfer data from one sheet to another based on dropdown

    I just want to check if you wanted this to work on any ws or just MKT.

    As for the merged cells, if you want to cut rows then I would suggest removing all the merged rows.

  5. #5
    Registered User
    Join Date
    08-20-2013
    Location
    São Paulo, Brazil
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: VBA code to automatically transfer data from one sheet to another based on dropdown

    yes,

    I want it to work on other worksheets as well.

    There is no way to cut and paste with merged cells? If there isn't that is fine, the merged cells are purely asthetics.

    Thanks

  6. #6
    Registered User
    Join Date
    08-20-2013
    Location
    São Paulo, Brazil
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: VBA code to automatically transfer data from one sheet to another based on dropdown

    XeRo,

    here is a copy of the file without the merged cells.

    Think you can help me out?

  7. #7
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: VBA code to automatically transfer data from one sheet to another based on dropdown

    There must be some confusion. Both of the attachments have multiple merged cells. Once you have moved all the data into its own cell and formatted the column and row sizes as you would like try:
    Please Login or Register  to view this content.
    The reason all the data has to be in its own cell is, you asked that the rows be deleted once the information is copied. With merged cells one row is only part of a cell. You can't delete a "part" of a cell and the delete command will error out.
    Last edited by Solus Rankin; 08-21-2013 at 04:10 PM. Reason: additional info

  8. #8
    Registered User
    Join Date
    08-20-2013
    Location
    São Paulo, Brazil
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: VBA code to automatically transfer data from one sheet to another based on dropdown

    Hey XeRo,

    That's weird, I must have unmerged cells just on one tab. Sorry about that.

    I just rearranged the rows and all that without merging anything and it worked beautifully, thanks a lot.

    Is there any way for me to keep the formatting when it automatically switches the data to the "completed" tab?
    If not, that's totally fine, what's important is that it's working, the formatting I can do manually, shouldn't take too much time.

    Thanks a lot for your help!

  9. #9
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: VBA code to automatically transfer data from one sheet to another based on dropdown

    Try this edit (its untested):
    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    08-20-2013
    Location
    São Paulo, Brazil
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: VBA code to automatically transfer data from one sheet to another based on dropdown

    Didn't work, what it doesn't keep the original formatting, but makes all the columns the same format, a random one; which is completely fine.

    Don't worry about it man, you can put solved on this one.

    thanks a lot!

  11. #11
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: VBA code to automatically transfer data from one sheet to another based on dropdown

    Okay. Well if you're happy with the solution please mark the thread as [SOLVED] by using the thread tools at the top.

    Only the person who created the thread can do that

+ 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. Replies: 1
    Last Post: 05-04-2013, 06:42 PM
  2. [SOLVED] Automatically transfer data from master sheet to others...
    By seanallen in forum Excel General
    Replies: 9
    Last Post: 04-10-2013, 06:33 PM
  3. Transfer Data to another sheet automatically
    By jmisti2 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-21-2012, 03:14 PM
  4. Need to automatically transfer data from survey sheet to paste sheet.
    By MWD Hand in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 01-29-2012, 08:03 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