+ Reply to Thread
Results 1 to 8 of 8

Matching time (hh:mm:ss)

  1. #1
    Registered User
    Join Date
    04-19-2013
    Location
    Paris
    MS-Off Ver
    Excel 2010
    Posts
    6

    Matching time (hh:mm:ss)

    Hello,

    I am trying to make a macro excel but there is some problem when I try to use "Find" for hour format.

    I have a file excel and in the first sheet I have a column with the date and another one with the hour

    Then I have many other sheets (in the file attached it is just an example with 2 sheets) so for every row in my first sheet I have to find the sheet that there is the same date and to find the row with the same hour and finally copy the sum of the 3d column in the first sheet (u can see in the file the result in red on the first row)

    Can u help me pleaaaseee
    Attached Files Attached Files

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Matching time (hh:mm:ss)

    Why don't you keep all the data in a single sheet instead of keeping it as individual sheets? If you have a single master sheet then you don't need any special code to do that job and you can retrieve it using inbuilt worksheet function itself.


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  3. #3
    Registered User
    Join Date
    04-19-2013
    Location
    Paris
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Matching time (hh:mm:ss)

    Hello,

    Because the data in every sheet is a data which is added every day and I receive the files like that...

  4. #4
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Matching time (hh:mm:ss)

    You can simply allocate a column and put date and keep it in single sheet. Is it possible?

  5. #5
    Registered User
    Join Date
    04-19-2013
    Location
    Paris
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Matching time (hh:mm:ss)

    I don't think so because I really receive the files in that format but I think that the hardest is to match the hour because it returns me error when I try... and I made it for the date... so I ask u to help me with the macro which finds the same hour like in my first sheet

  6. #6
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Matching time (hh:mm:ss)

    Nancy,
    See attached.
    I had a hard time changing the date in column A of sheet1 as these dates are not the same as the dates on the other sheets.
    The dates are so stubborn that I can't even format them, so I had to do it manually(Luckily there are few only). If the dates are not formatted as the same as the other sheets, the code will not find a match since when I combine the two columns, I get zero match. The code works as you see, it returns the correct cells, but in your actual data, you need to make sure that the dates in sheet1 column A are formatted correctly, so they are the same.
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    04-19-2013
    Location
    Paris
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Matching time (hh:mm:ss)

    Quote Originally Posted by AB33 View Post
    Nancy,
    See attached.
    I had a hard time changing the date in column A of sheet1 as these dates are not the same as the dates on the other sheets.
    The dates are so stubborn that I can't even format them, so I had to do it manually(Luckily there are few only). If the dates are not formatted as the same as the other sheets, the code will not find a match since when I combine the two columns, I get zero match. The code works as you see, it returns the correct cells, but in your actual data, you need to make sure that the dates in sheet1 column A are formatted correctly, so they are the same.
    THank u very much Yes there is a way to change the year thanks again

  8. #8
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Matching time (hh:mm:ss)

    Nancy,
    You are welcome!
    Glad it has worked for you as I had spent long time on this code.

+ 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