+ Reply to Thread
Results 1 to 8 of 8

VBA - Copy and Paste data based on two criteria to specific start row and column

  1. #1
    Registered User
    Join Date
    05-28-2012
    Location
    london
    MS-Off Ver
    Excel 2010
    Posts
    4

    VBA - Copy and Paste data based on two criteria to specific start row and column

    Good evening Gurus...i need some MACRO (in every sense of the word) assistance

    I have a file (see attached sample) with two tabs

    Tab1 is the input tab where data for each participant is manually entered into the GAMEx columns based on the results of the questions. the questions change dynamically dependent on which participant is selected from dropdown.

    Tab2: Output and archive tab. contains a set of static questions used to change the questions in the Input tab. Also contains static columns where i would like to keep an 'archive' of scores for each participant dependent on which game was played.

    (Hope it all makes sense so far)

    So the help required

    I would like to create a macro (button) that copies the game data for each participant from the Input Tab (based on the name and Gamex) and 'stores' it in the correct set of rows and columns in the Output tab e.g Selects Game 2 results for Mark and stores them in Cells H9:J13 etcTest_copy.xlsx

  2. #2
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,810

    Re: VBA - Copy and Paste data based on two criteria to specific start row and column

    Try:
    Please Login or Register  to view this content.
    You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
    Practice makes perfect. I'm very far from perfect so I'm still practising.

  3. #3
    Registered User
    Join Date
    05-28-2012
    Location
    london
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: VBA - Copy and Paste data based on two criteria to specific start row and column

    Thanks Mumps1 for your reply and code.

    The code was able to copy the right data however when the game number is changed it does not paste the data in the right set of columns. ( I think that is my fault because i did not explain properly and there were some errors in the original file i attached)

    i have attached an updated file and hopefully given a better explanation of the process i follow when using the file below.

    Tab1: Input Tab
    Step 1: Enter game # in B1 (this changes the major heading to Game #)
    Step 2: Select Player (this changes the questions dynamically so they are specific to each player)
    Step 3: Enter results in range E5 to G9


    Tab2: Archive tab.
    - Contains a set of static questions that form a question bank for the players questions in the Input tab.
    - Also contains static columns where i would like to stores scores for each participant dependent on which game was played.

    (Hope it all makes sense so far)

    So the help required please
    I would like to create a macro (button) that copies the game data for each participant from the Input Tab (based on the name and Game #) and 'stores' it in the correct set of rows and columns in the Output tab
    e.g Game 2 scores (values only) for Mark are stored in Cells H9 to J13 of Archive tab when the button is pressed.
    Game 3 scores (values only) for John are stored in Cells K4 to M8 etc..

    Thanks in advance for your help and ideas Mumps1 and gurus
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    05-28-2012
    Location
    london
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: VBA - Copy and Paste data based on two criteria to specific start row and column

    I forgot to mention also that the number of players in my real file is about 150...but i reckon if i can get an idea of how to perform the dynamic cut and paste for at least i will be able to extrapolate for the rest

    Thanks again

  5. #5
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,810

    Re: VBA - Copy and Paste data based on two criteria to specific start row and column

    Try this macro. It should work regardless of how many players you add and how many games you add.
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    05-28-2012
    Location
    london
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: VBA - Copy and Paste data based on two criteria to specific start row and column

    Thanks Mumps1! you are the GURU It worked perfectly!

  7. #7
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,810

    Re: VBA - Copy and Paste data based on two criteria to specific start row and column

    My pleasure.

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

    Re: VBA - Copy and Paste data based on two criteria to specific start row and column

    Ndgo10,

    A note to you - in future, please do not post the same question in the paid forum and in the free forum. Its against the rules.

    Thanks,
    Admins
    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] Copy entire row based on 2 criteria and paste on the next blank row on a specific sheet
    By ALNER in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-25-2014, 11:23 PM
  2. [SOLVED] Copy/Paste a column in a new sheet based on a criteria
    By Elorac in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-19-2013, 02:01 PM
  3. Replies: 0
    Last Post: 07-16-2013, 05:22 AM
  4. [SOLVED] Copy and paste data from sheet 2 to sheet 1 based on specific criteria on sheet 1
    By VBADUD in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-05-2012, 04:18 AM
  5. Copy & paste specific column based on cell reference
    By ccsmith in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-26-2011, 03:59 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