Results 1 to 3 of 3

Thread: Query: Combining two sets of data into one

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2006
    Posts
    2

    Query: Combining two sets of data into one

    Hi guys,

    I've got a question about creating reports in VBA for EXCEL that I was wondering if it could be done. I currently have two sheets with the following forms of information in them:

    Sheet 1:

    Name, Date , Value
    --------------------------------
    TAG1, 10-Apr-06, 2.6
    TAG2, 11-Apr-06, 1.2
    TAG3, 10-Apr-06, 0.3

    Sheet 2:

    Name, Date, Value
    --------------------------------
    TAG2, 12-Apr-06, 3.3
    TAG4, 15-Apr-06, 5.0
    TAG5, 20-Apr-06, 4.7

    And I need them to be combined to generate a report in the following format:

    Report:

    Name, Date1, Date2, Value1, Value2
    ----------------------------------------------------------------
    TAG1, 10-Apr-06,, 2.6,
    TAG2, 11-Apr-06, 12-Apr-06, 1.2, 3.3
    TAG3, 10-Apr-06,, 0.3,
    TAG4,, 15-Apr-06,, 5.0
    TAG5,, 20-Apr-06,, 4.7

    The problem is that I can't simply combine two sheets together because the names don't exist in the same sheets (i.e. TAG1 is only in sheet1). I tried doing a search statement but it is proving too cumbersome.

    Is there an easy solution two combine the two such as arrays, or another method? I'm stuck at the moment

    Any help would be awesome

  2. #2
    Don't Panic! Ecniv's Avatar
    Join Date
    Nov 2000
    Location
    Amsterdam...
    Posts
    5,343

    Re: Query: Combining two sets of data into one

    Don't follow why you cannot just cut n paste into a new sheet...?

    BOFH Now, BOFH Past, Information on duplicates

    Feeling like a fly on the inside of a closed window (Thunk!)
    If I post a lot, it is because I am bored at work! ;D Or stuck...
    * Anything I post can be only my opinion. Advice etc is up to you to persue...

  3. #3

    Thread Starter
    New Member
    Join Date
    Jun 2006
    Posts
    2

    Re: Query: Combining two sets of data into one

    The reason is that I'm trying to automate it. It's meant to generate a report from the first two sheets. The information is actually a lot more complex than I provided, I just simplified it as an example.

    Edit: Actually, I just figured it out. Just used arrays and a VLOOKUP table in the end. Thanks.
    Last edited by gstack; Jun 6th, 2006 at 11:07 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width