+ Reply to Thread
Results 1 to 8 of 8

Combining (match and append) data from two sheets into third in VBA (2003) please

  1. #1
    Registered User
    Join Date
    09-04-2012
    Location
    Plymouth, UK
    MS-Off Ver
    Excel 2010
    Posts
    26

    Question Combining (match and append) data from two sheets into third in VBA (2003) please

    Hi All,

    First, this forum has taught me a lot so thank you to all contributors.

    I have tried to code a particular issue, but cannot get working code, so I thought I'd put it out there to see if anyone can help (I have tried searching the forum but was unable to find a specific match to my requirements).

    To simplify the matter:
    Excel 2003 workbook with 3 sheets - Normal, Overtime, and Combined.

    Part 1 is simply to copy/paste all records from Normal to Combined - that's done.
    Part 2 where I got stuck was - for every record in Combined: Search Overtime sheet for matching Name,
    and if found, update the Hours Worked column on the Combined sheet so they total the Hours from Normal + Overtime if matched.

    Real app is much more data, but once I understand how to do it, I will adapt it.

    One side question:
    The time data I work with is in the format [hh]:mm:ss - but I also have data in decimal format, e.g 25.00.
    What is the best way to convert the decimal value to [hh]:mm:ss? I tried just changing the format but it came up with a non-sensible value?

    Hope the very basic demo attached is enough.

    Thank you all for your assistance.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Combining (match and append) data from two sheets into third in VBA (2003) please

    Hi

    1) Some quick code to do the summation
    Please Login or Register  to view this content.
    2) What does the 25.00 represent? 25 hours 0 minutes? 25.0 minutes?

    rylo

  3. #3
    Registered User
    Join Date
    09-04-2012
    Location
    Plymouth, UK
    MS-Off Ver
    Excel 2010
    Posts
    26

    Re: Combining (match and append) data from two sheets into third in VBA (2003) please

    Wow - that was quick! Will try it and let you know. As for the 25.00 it is 25 hours.

    Thank you very much indeed!

  4. #4
    Registered User
    Join Date
    09-04-2012
    Location
    Plymouth, UK
    MS-Off Ver
    Excel 2010
    Posts
    26

    Re: Combining (match and append) data from two sheets into third in VBA (2003) please

    Works like a charm! Cannot thank you enough!

  5. #5
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Combining (match and append) data from two sheets into third in VBA (2003) please

    Hi

    For the hours thing, try something like
    =TIMEVALUE(TEXT(E2/24,"hh:mm"))
    where the 25.00 was in E2.

    rylo

  6. #6
    Registered User
    Join Date
    09-04-2012
    Location
    Plymouth, UK
    MS-Off Ver
    Excel 2010
    Posts
    26

    Re: Combining (match and append) data from two sheets into third in VBA (2003) please

    Thanks Rylo, but when I tried it, it returned 0.041666667

    Am I missing something?

  7. #7
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Combining (match and append) data from two sheets into third in VBA (2003) please

    Hi

    What would you expect it to return? What do you want to do with it?

    rylo

  8. #8
    Registered User
    Join Date
    09-04-2012
    Location
    Plymouth, UK
    MS-Off Ver
    Excel 2010
    Posts
    26

    Re: Combining (match and append) data from two sheets into third in VBA (2003) please

    Sorry - probably wasn't clear. If the cell has 25.00 then I would like to turn it into 25:00:00 and so forth.

    Appreciate the assistance.

+ 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