sharky12345
Well-known Member
- Joined
- Aug 5, 2010
- Messages
- 3,422
- Office Version
- 2016
- Platform
- Windows
I'm trying to find to get a series of values in a MsgBox if criteria is met.
If the value in Column F is 'Overdue' I need values from the same row populated in a Msgbox then a newline and then the next row of data that matches the criteria, so I would end up with 1 message with the values from every row that matches my criteria.
The problem I'm having is that the MsgBox only displays the first found range. This is what I have so far;
Can someone point me in the right direction please?
If the value in Column F is 'Overdue' I need values from the same row populated in a Msgbox then a newline and then the next row of data that matches the criteria, so I would end up with 1 message with the values from every row that matches my criteria.
The problem I'm having is that the MsgBox only displays the first found range. This is what I have so far;
Code:
If cell.Offset(0, 5).Value = "Overdue" Then
OverDueWeeklyText = "Reg: " & cell.Offset(0, 1).Value & vbNewLine & _
"Vehicle: " & cell.Offset(0, 2).Value & vbNewLine & _
"Last recorded check: " & cell.Offset(0, 3).Value & vbNewLine & _
"Days since last check: " & cell.Offset(0, 4).Value
End If
Next
MsgBox "The following vehicles are shown as overdue their weekly checks;" & vbNewLine & vbNewLine & OverDueWeeklyText
Can someone point me in the right direction please?