Hi. I'm pretty new to VBA coding, and have been given the task of adding a warning popup box when a certain cell (merged into others so this one cell occupies the space of 6), exceeds another cell's Value (which also occupies 6 cells as 1).
The first cell shows a weekly labour budget that is calculated from others dotted around the sheet with regards to target labour of 26%, divided from a weekly sales forecast = budget (cell S9). The other cell which is the cell in question is a running total of spend in £ value (cell L9). Whilst the sheet is populated with Start & Finish times manually by the store manager (on same sheet), in real time the value calculates the total wage for the day for each staff member listed as they go, x hourly rate = total wage, which is in a hidden column, then L9 is a simple =SUM to show total labour spend of those smaller values.
What I would like to happen is when L9 exceeds S9, a message box jumps out and says, "Labour Budget exceeded. Please reconfigure." I would also like the code to undo the last input just before the message box was triggered due to L9 being greater than S9.
I found some existing code listed in another thread (didn't have the undo last entry bit though), attempted to incorporate that on the VBA code screen for the sheet with a few reference changes, but it does absolutely nothing. It's as if the code isn't even there!
When I Save, and click the green 'play' button to run the code, it asks me to create a Macro. Wtf ??? Am I missing something here, coz I have no clue what's happening.
I would post my work for you to see but I don't have it with me at the moment. I'm sure you smartypants out there have the answer that makes it so obvious. Any help would be massively appreciated.
The first cell shows a weekly labour budget that is calculated from others dotted around the sheet with regards to target labour of 26%, divided from a weekly sales forecast = budget (cell S9). The other cell which is the cell in question is a running total of spend in £ value (cell L9). Whilst the sheet is populated with Start & Finish times manually by the store manager (on same sheet), in real time the value calculates the total wage for the day for each staff member listed as they go, x hourly rate = total wage, which is in a hidden column, then L9 is a simple =SUM to show total labour spend of those smaller values.
What I would like to happen is when L9 exceeds S9, a message box jumps out and says, "Labour Budget exceeded. Please reconfigure." I would also like the code to undo the last input just before the message box was triggered due to L9 being greater than S9.
I found some existing code listed in another thread (didn't have the undo last entry bit though), attempted to incorporate that on the VBA code screen for the sheet with a few reference changes, but it does absolutely nothing. It's as if the code isn't even there!
When I Save, and click the green 'play' button to run the code, it asks me to create a Macro. Wtf ??? Am I missing something here, coz I have no clue what's happening.
I would post my work for you to see but I don't have it with me at the moment. I'm sure you smartypants out there have the answer that makes it so obvious. Any help would be massively appreciated.