+ Reply to Thread
Results 1 to 9 of 9

Work out Time in and out based on Cell format

  1. #1
    Registered User
    Join Date
    11-22-2008
    Location
    Brisbane, Australia
    MS-Off Ver
    2003
    Posts
    23

    Work out Time in and out based on Cell format

    Hey guys, I have a sheet that I want to calculate what time a shift starts based on a cell shading.

    Basically Cells C6 and D6 need to be auto calculated based on the cells that are shaded from G6:L6

    Look at the Attachment and you will see what I mean.

    Thanks in advance.
    Attached Files Attached Files
    Last edited by merilvingian; 01-15-2009 at 06:26 AM.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello merilvingian,

    I see you have a macro (UDF) written aand are using in with worksheet IF statements. What do you want to do differently?

    Sincerely,
    Leith Ross

  3. #3
    Registered User
    Join Date
    11-22-2008
    Location
    Brisbane, Australia
    MS-Off Ver
    2003
    Posts
    23
    Hi Thanks for the reply,

    I would like the time to be worked out automatically. Not the hours worked, but when the line starts and finishes in each row. Each column represents half an hour.

    So when the line starts on G6 and finishes on L6 That would be 6am to 9am

    Thanks
    Steven

    Quote Originally Posted by Leith Ross View Post
    Hello merilvingian,

    I see you have a macro (UDF) written aand are using in with worksheet IF statements. What do you want to do differently?

    Sincerely,
    Leith Ross

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello Steven,

    I just noticed your in Brisbane. Is that Brisbane, CA? Just to be sure I understand this, you want the time in columns "C" and "D" to be filled in when the cells in columns "G:L" are colored?

    Sincerely,
    Leith Ross

  5. #5
    Registered User
    Join Date
    11-22-2008
    Location
    Brisbane, Australia
    MS-Off Ver
    2003
    Posts
    23
    Hey, Nah Brisbane Australia, and yes thats exactly what I want it to do.

    Quote Originally Posted by Leith Ross View Post
    Hello Steven,

    I just noticed your in Brisbane. Is that Brisbane, CA? Just to be sure I understand this, you want the time in columns "C" and "D" to be filled in when the cells in columns "G:L" are colored?

    Sincerely,
    Leith Ross

  6. #6
    Registered User
    Join Date
    11-22-2008
    Location
    Brisbane, Australia
    MS-Off Ver
    2003
    Posts
    23
    Anyone had any luck yet?

  7. #7
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello Steven,

    It times like these that make me think the universe (perhaps multiverse) just likes to mess with me. My wife comes home from work sick, my computer crashes twice and now the forum is running really slow. So, I am going to rewrite the code, keep my fingers crossed and not beg the question.

    Sincerely,
    Leith Ross

  8. #8
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello Steven,

    Finally, it is done. Here is the macro that has been installed in the attached workbook. It updates the times once you move outside the "bars" table.
    Please Login or Register  to view this content.
    Worksheet Selection Change Event Code
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    11-22-2008
    Location
    Brisbane, Australia
    MS-Off Ver
    2003
    Posts
    23
    WOW Thanks heaps. Awesome work.

    And sorry to hear that your wife is sick, I hope she gets better.

    Thank you so much.

    Best regards
    Steven

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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