+ Reply to Thread
Results 1 to 10 of 10

Help with Macro to Copy/Paste cells to different worksheet based on Value

  1. #1
    Registered User
    Join Date
    01-25-2012
    Location
    Berkeley, Ca
    MS-Off Ver
    Excel 2007
    Posts
    13

    Help with Macro to Copy/Paste cells to different worksheet based on Value

    Hello,

    I have a workbook for collecting body composition information. Every month a group of 10-50 people with have their body composition analyzed and I would like to compile the results on to worksheets based on each name. When I run a new test some of the name could change and each person will have a differing number of previous test. I can no figure out how to set up a macro to search the the worksheet names and match to the value off the master sheet, then past the information from the master into the first open row. I would also like to figure out an msgbox/error box for if a name does not match a worksheet to either change the name or add a new sheet. I have attached the workbook with a few of my bad attempts at a macro. I am also open to suggestions if there is any easier way to organize this process. Any help would be greatly appreciated.

    Thanks

    Body Comp Template.xlsm

  2. #2
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Help with Macro to Copy/Paste cells to different worksheet based on Value

    Hi BehrBrew

    Will the Data in Master ALWAYS be new Data (Data that's not been previously transfered)?
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  3. #3
    Registered User
    Join Date
    01-25-2012
    Location
    Berkeley, Ca
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: Help with Macro to Copy/Paste cells to different worksheet based on Value

    Jaslake,

    Yes. That will be the most current data. The only history will be on the individual tabs. If it is easier to set up a running data page that contains the entire history, that would be okay. I would just need to set a page for the current results for the the group supervisor.

    Thanks for your help.

  4. #4
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Help with Macro to Copy/Paste cells to different worksheet based on Value

    Hi BehrBrew

    I've added two Modules to your Sample Workbook and an additional Worksheet named "Template".

    In order for the Code in Module Transfer to function properly the Formulas in the Individual Player sheets in Range("B3:F33") need to be cleared. This Code does that
    Please Login or Register  to view this content.
    The Code in Module Transfer is the Code that distributes the Master Records to the Individual Player sheets. The Code will add a new Worksheet for any new Player if the Individual Player sheet does not already exist. You'll receive a message that the New Player Sheet has been added. This Code runs from a Button on Master sheet.
    Please Login or Register  to view this content.
    I've not monkeyed with Cells B34 to G39 in the Individual Player Sheets...only you know what these are to do. Of course, try the Code n the Sample file and/or a COPY of your live file. Let me know of issues.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    01-25-2012
    Location
    Berkeley, Ca
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: Help with Macro to Copy/Paste cells to different worksheet based on Value

    Jaslake,

    That is amazing. Works better than I was even hoping. I'm sure it will take me a while to figure out how you did it but thanks you so much.

    Thanks again

  6. #6
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Help with Macro to Copy/Paste cells to different worksheet based on Value

    You're welcome...glad I could help.

  7. #7
    Registered User
    Join Date
    11-25-2013
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Help with Macro to Copy/Paste cells to different worksheet based on Value

    My question is similar (I think). I have a file with names down column B in sheet 1 and want to transfer all cells C to AA in this row associated with specific names in this sheet to worksheet 2 which is set up with all the same headings. I can write a macro to copy the data but need to get the macro to look for the name in the cell in sheet 2 where I have the name I want the data transferred for. How do I get it to do this for each new cell I go to for which I want to extract the data from sheet 1 - can anyone help please?

  8. #8
    Registered User
    Join Date
    11-25-2013
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Help with Macro to Copy/Paste cells to different worksheet based on Value

    I ran this macro for one name but need to do it for different names - so I need to get the macro to use the name I run in the cell I'm in when I run it:

    Please Login or Register  to view this content.
    Last edited by arlu1201; 11-25-2013 at 06:40 AM.

  9. #9
    Registered User
    Join Date
    11-25-2013
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Help with Macro to Copy/Paste cells to different worksheet based on Value

    So I need the replace "Andrew Dibby" with the name in each cell I want the data for in sheet 2

  10. #10
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Help with Macro to Copy/Paste cells to different worksheet based on Value

    MaryCW,

    Welcome to the forum.

    2 pointers - 1. I have added code tags to your post. As per forum rule 3, you need to use them whenever you put any code in your post. Please add them in future. In order to put code tags, either type [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] at the end of it, OR you can highlight your code and click the # icon at the top of your post window.

    2. Unfortunately you need to post your question in a new thread, it's against the forum rules to post a question in the thread of another user. If you create your own thread, any advice will be tailored to your situation so you should include a description of what you've done and are trying to do. Also, if you feel that this thread is particularly relevant to what you are trying to do, you can surely include a link to it in your new thread.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ 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] Trying to copy and paste certain cells from one worksheet to another using a macro
    By renec in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 04-26-2013, 11:55 PM
  2. [SOLVED] Macro - Copy and Combine values in cell and paste it in other cells based on Unique ID
    By haleakala17 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-11-2012, 05:41 PM
  3. Excel Macro to insert two rows based on condition and copy and paste multiple cells
    By mannabhalo in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-13-2012, 12:56 PM
  4. Copy Paste cells into a new sheet based on criteria macro
    By Clessie1919 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-19-2012, 02:43 AM
  5. Macro for WS/WB comparisons, and copy/paste two cells based on matches
    By adilley in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-13-2011, 10:46 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