Consulting

Results 1 to 9 of 9

Thread: Another Conundrum

  1. #1
    VBAX Regular
    Joined
    Aug 2011
    Posts
    17
    Location

    Another Conundrum

    Same workbook (attached)

    "Timesheet" Column N - Total Hours is populated when I run the code.
    The cells in Column N have conditional formatting in them that will turn the cell in Total Hours Red if the time entered by a timekeeper in
    H2, J2, L2 are Greater than the populated amount in N2.

    What I need to do is insert a yes/no check box in A2:A300 with an IF Statement that says
    IF checked yes, then Sum H2,J2,L2 and Total them in N2 but also turn the cell Green.
    IF checked No then keep the populated total the same and keep the cell Red.
    I hope I explained this properly. See attached.
    This is very important so any help is as always appreciated.

    Thanks,
    Attached Files Attached Files

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Try this
    Attached Files Attached Files
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    VBAX Regular
    Joined
    Aug 2011
    Posts
    17
    Location
    couple of issues, the initial code is run via $ in the menu bar
    This will copy the "Gate Log" into the "Timesheet"
    the column "Total Hours" has a conditional format to turn the cell Red when a timekeeper enter values into the STHours,OTHours, and DTHours rows for that particular persons time, if those totals are greater than the
    populated total hours then the cell will turn Red and the total of sthours,othours and dthours will not calculate into the Total Hours cell. but wrather will remain at the populated value.
    what Iam trying to do is place a check box in "Murphy Approval" column
    that when checked will allow the timekeepers entry to calculate into the
    "Total Hours" cell over riding the populated value from the initial code and turn the cell Green reflecting that it has been approved.


    I truly appreciate all of the help I am getting here and I am learning.

  4. #4
    VBAX Regular
    Joined
    Aug 2011
    Posts
    17
    Location
    up !!

  5. #5
    Moderator VBAX Wizard Aussiebear's Avatar
    Joined
    Dec 2005
    Location
    Queensland
    Posts
    5,059
    Location
    Quote Originally Posted by paleaux
    couple of issues, the initial code is run via $ in the menu bar
    This will copy the "Gate Log" into the "Timesheet"
    Does this above section still work correctly? Just what exactly does get copied from Gate Log to TimeSheet? (Employees name, Date, Total Hours?)

    the column "Total Hours" has a conditional format to turn the cell Red when a timekeeper enter values into the STHours,OTHours, and DTHours rows for that particular persons time, if those totals are greater than the
    populated total hours then the cell will turn Red and the total of sthours,othours and dthours will not calculate into the Total Hours cell. but wrather will remain at the populated value.
    I am confused with your description here and the formulas applied in the workbook.

    I am assuming that you are trying to test the sum value of ST_Hrs + OT_Hrs + DT_Hrs against the Total Hours value, and that the Total Hours value (Populated value) is linked to the Gate_Log Hours for this particular employee on a particular date.

    If its not equal then the cell is formatted to turn red, else it remains a standard cell colour. Then once an approval is gained for the Total hours value ( by placing a tick mark in column A, the cell formatting turns green.

    Is this correct?
    Remember To Do the Following....
    Use [Code].... [/Code] tags when posting code to the thread.
    Mark your thread as Solved if satisfied by using the Thread Tools options.
    If posting the same issue to another forum please show the link

  6. #6
    VBAX Regular
    Joined
    Aug 2011
    Posts
    17
    Location
    Aussie thanks for the reply, here is perhaps a better explanation..

    Here is the issue currently I have vba copying a criteria into the "Timesheet"
    from another sheet "Gate Log"
    Works fine with no issue...
    Cells in O2:O300 have conditional form at that, if the manually entered time in
    I2,K2,M2 are greater than the value in O2 (populated by vba) then O2 will turn Red and will not Total the hours from I2,K2,M2 in O2.

    What I need is another condition.
    Check Box located in A2, if check box is checked, then Sum I2,K2,M2 in O2 and
    turn Green.

    Problem is I can not get this to work.
    I don't know if this will have to be driven via:vba or if it can be done thru conditional formatting. I have tried every I know about conditional formatting
    and nothing seems to work, so I beginning to think that the vba is over riding the
    conditional format and not allowing it. But once again I am basically a novice and am unsure of this. I have read almost every post on conditional formatting and still I am stuck.

    any advise, is appreciated...

  7. #7
    Moderator VBAX Wizard Aussiebear's Avatar
    Joined
    Dec 2005
    Location
    Queensland
    Posts
    5,059
    Location
    We are going round in circles again....
    Remember To Do the Following....
    Use [Code].... [/Code] tags when posting code to the thread.
    Mark your thread as Solved if satisfied by using the Thread Tools options.
    If posting the same issue to another forum please show the link

  8. #8
    VBAX Master Aflatoon's Avatar
    Joined
    Sep 2009
    Location
    UK
    Posts
    1,720
    Location
    Not only here but also at the Code Cage here.
    Be as you wish to seem

  9. #9
    Moderator VBAX Guru Simon Lloyd's Avatar
    Joined
    Sep 2005
    Location
    UK
    Posts
    3,003
    Location
    Please read the link in my signature with regards cross posting!
    Regards,
    Simon
    Please read this before cross posting!
    In the unlikely event you didn't get your answer here try Microsoft Office Discussion @ The Code Cage
    If I have seen further it is by standing on the shoulders of giants.
    Isaac Newton, Letter to Robert Hooke, February 5, 1675 English mathematician & physicist (1642 - 1727)

Posting Permissions

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