Hi,
I am looking for some help to expand the formula i have. On the table below i want a message box to appear when column D is higher then column C which i have managed to code myself. However where i am struggling with is that i want the message box to display how much higher D is than C.
<colgroup><col><col><col><col></colgroup><tbody>
</tbody>
Just now i have the below code:
Private Sub DataAnalysis()
Dim Overbreaks As Integer
For i = 3 To 13
If Sheet1.Range("D" & i).Value > Sheet1.Range("C" & i).Value Then
Sheet1.Range("D" & i).Select
Overbreaks = ActiveCell.Value + Sheet1.Range("C" & i)
MsgBox (Overbreaks)
End If
Next
End Sub
However this doesnt seem to work.
I also want in the message box to return "Agent name (Column A) was over their break by Overbreaks (Column D - Column C)"
I am looking for some help to expand the formula i have. On the table below i want a message box to appear when column D is higher then column C which i have managed to code myself. However where i am struggling with is that i want the message box to display how much higher D is than C.
Paid Breaks | |||
Name | Shift (Hours) | Break Time Available | Break Time Used |
Agent1 | 7.00 | 00:16:48 | 0:18:17 |
Agent2 | 7.00 | 00:16:48 | 0:16:14 |
Agent3 | 7.00 | 00:16:48 | 0:11:23 |
Agent4 | 6.00 | 00:14:24 | 0:14:57 |
Agent5 | 7.00 | 00:16:48 | 0:16:43 |
Agent6 | 4.00 | 00:09:36 | 0:10:53 |
Agent7 | 7.00 | 00:16:48 | 0:18:20 |
Agent8 | 7.00 | 00:16:48 | 0:15:11 |
Agent9 | 7.00 | 00:16:48 | 0:16:24 |
Agent10 | 7.00 | 00:16:48 | 0:08:10 |
Agent11 | 7.00 | 00:16:48 | 0:16:29 |
<colgroup><col><col><col><col></colgroup><tbody>
</tbody>
Just now i have the below code:
Private Sub DataAnalysis()
Dim Overbreaks As Integer
For i = 3 To 13
If Sheet1.Range("D" & i).Value > Sheet1.Range("C" & i).Value Then
Sheet1.Range("D" & i).Select
Overbreaks = ActiveCell.Value + Sheet1.Range("C" & i)
MsgBox (Overbreaks)
End If
Next
End Sub
However this doesnt seem to work.
I also want in the message box to return "Agent name (Column A) was over their break by Overbreaks (Column D - Column C)"