+ Reply to Thread
Results 1 to 7 of 7

Data collation macro edit

  1. #1
    Registered User
    Join Date
    11-22-2009
    Location
    Newcastle,England
    MS-Off Ver
    Excel 2003
    Posts
    78

    Data collation macro edit

    I have the following macro which collates data from a number of sheets in to the ones i specify and excludes the ones i specify.

    Please Login or Register  to view this content.
    My problem is that this macro currently offsets the data it copies from each sheet. This is perfectly fine however until i come to a scenario as such shown by these lines:

    Please Login or Register  to view this content.
    produce:

    Please Login or Register  to view this content.

    My problem is that i want the team name which is in the first column (A) to be in line with the first name of the person in that team. But due to the way the macro offsets data the closest i can achieve is with an offset set to 12 which as you can see puts the team name at the bottom of the list of names.

    If i alter the offset to a lower value such as 1 i get the team names just 1 after another and then the actual team member names beside this as seen here:


    Please Login or Register  to view this content.

    I want the macro to show the data as this:

    Please Login or Register  to view this content.
    Thanks for any help

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Data collation macro edit

    Posting a sheet would make this much simpler to "test" for you, but perhaps this:
    Please Login or Register  to view this content.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    11-22-2009
    Location
    Newcastle,England
    MS-Off Ver
    Excel 2003
    Posts
    78

    Re: Data collation macro edit

    Thanks for that, I will give it a try at work tomorrow ( I can not upload files as I work for the government and they block it ) however, thanks once again.

    Would you be able to explain what this addition is doing with the lines you have added, will help me to learn when I need to do some editing in the future. I had 0 knowledge of vba/macros a month ago

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Data collation macro edit

    Commented code:

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    11-22-2009
    Location
    Newcastle,England
    MS-Off Ver
    Excel 2003
    Posts
    78

    Re: Data collation macro edit

    Code runs perfect bar the very last line of the output

    Please Login or Register  to view this content.

    It gives DN1 twice which is the last record it pastes, whereas all the others come up perfect.

    Code I am using:

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    11-22-2009
    Location
    Newcastle,England
    MS-Off Ver
    Excel 2003
    Posts
    78

    Re: Data collation macro edit

    Still not been able to find out how to fix this

  7. #7
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Data collation macro edit

    Perhaps it's time to provide a sample workbook where we can see the undesired behavior in action.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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