+ Reply to Thread
Results 1 to 6 of 6

Macro Help - copying A to B under changing specific criteria

  1. #1
    Registered User
    Join Date
    11-16-2016
    Location
    Southampton, England
    MS-Off Ver
    2007
    Posts
    3

    Macro Help - copying A to B under changing specific criteria

    Hi all

    I am not the most savvy of excel users but it is essential for my job role and I am more than willing to learn.

    My workbook contains over 1600 individuals, I have been asked to start including a new set of data for each individual. Due to the report system at my workplace, I will have to update each individual one by one which will take me a very long time indeed. I could do it manually but I aim to create a macro that will speed up things.
    I have two worksheets, I'll name them Alpha and Beta.
    Alpha contains a table in which I have copied data from our reports into. This data is for one individual only (there are no large scale reports for multiple individuals). Alpha matches the format of the report.
    Beta contains all 1600 individuals with new data fields for the data I need in Alpha
    What I want to do is create a macro that will automatically take the data I have copied into Alpha and put it exactly where I want it in Beta but it has to be in the same row as the specific individual.
    Each individual has a unique identifier to link both worksheets together. I figured Vlookup would be the best function to use. How can I program a macro so if I was to put the unique identifier into Alpha, Excel would know where to find the unique identifier in Beta and copy the data from Alpha to Beta into the right location.
    I have attached an example. I've color coordinated it for better understanding of where I need things to go.
    I hope that all makes sense
    Any help will be greatly appreciated.
    Many thanks
    Nick
    Attached Files Attached Files

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,937

    Re: Macro Help - copying A to B under changing specific criteria

    Please explain the relationship between Alpha and Beta. I can see colored cells but cannot determine how the data in Alpha relates to Beta. There are dates in Alpha and no dates in Beta. How does this work. Your explanation is not clear enough to offer a solution. Suggest you explain in detail the relationships and criteria.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,937

    Re: Macro Help - copying A to B under changing specific criteria

    Please explain the relationship between Alpha and Beta. I can see colored cells but cannot determine how the data in Alpha relates to Beta. There are dates in Alpha and no dates in Beta. How does this work. Your explanation is not clear enough to offer a solution. Suggest you explain in detail the relationships and criteria.

  4. #4
    Registered User
    Join Date
    11-16-2016
    Location
    Southampton, England
    MS-Off Ver
    2007
    Posts
    3

    Re: Macro Help - copying A to B under changing specific criteria

    Many thanks for your reply. The only relationship between Alpha and Beta is the unique ID number. There are 1600 individuals in the actual workbook I have and they all have a unique ID number. The dates themselves are purely for my own reference with the actual data and I probably shouldn't of included them in the example. In Beta the dates have no significance as the data I collect is from different time frames for each individual.
    The colors are simply to show what data I need to copy and to where as an example.

    What I am basically trying to understand is if I was to input a different ID number into Alpha, how can I get excel to recognize this and place the data in Alpha in the same row as the unique ID in Beta. So it simply becomes a case of copying the data from the report and pasting into Alpha, run a macro which then places the data from Alpha into Beta into the right cells at the touch of a button.

  5. #5
    Forum Expert
    Join Date
    09-20-2011
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    2,278

    Re: Macro Help - copying A to B under changing specific criteria

    Hello
    I was working on this example before Alan replied, so I waited for your clarification. Does the macro in the attached file do as required. The ranges here are fixed to your example but could be amended to suit. The ID is taken from cell A3 on the Alpha sheet. However, this all depends on your data layout being consistent throughout.

    DBY
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    11-16-2016
    Location
    Southampton, England
    MS-Off Ver
    2007
    Posts
    3

    Re: Macro Help - copying A to B under changing specific criteria

    Hi DBY
    Many thanks on working on this for me, I really appreciate it. It is exactly what I had in mind. I'm going to try and implement it into my actual workbook and see the results. I will let you know how I get on.
    Thanks again
    Nick

+ 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] Macro copying rows to coulm based on specific criteria
    By srinivasan1965 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-27-2016, 11:52 PM
  2. [SOLVED] Copying values to 2nd sheet based on specific changing circumstances.
    By markDuffy in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 04-23-2015, 11:31 AM
  3. Need help with specific macro script for data copying in a specific format
    By Amit1 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-08-2014, 12:36 AM
  4. Copying specific data to a specific field in a worksheet macro
    By bradpeh in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-31-2013, 01:52 AM
  5. Replies: 6
    Last Post: 06-27-2012, 04:38 PM
  6. inserting, copying, changing based on criteria
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-12-2011, 12:39 PM
  7. Replies: 0
    Last Post: 05-06-2006, 01:10 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