Patriot2879
Well-known Member
- Joined
- Feb 1, 2018
- Messages
- 1,259
- Office Version
- 2010
- Platform
- Windows
Hi I have the code blow where popup message appears with info from row B and C, row B has the message and row C has the date, I would like to add a row D with the time (24 hour format like 13:54), please can you advise how I would add this to the code below? I hope you can help please?
Code:
Private Sub Workbook_Open()
Dim cell As Range, buf As String
With Sheets("Sheet1")
For Each cell In .Range("C:C").SpecialCells(xlConstants)
If cell >= Date - 1 And cell <= Date + 3 Then
buf = buf & vbNewLine & Format(cell.Value, " M/D/YYYY - ") & cell.Offset(, -1).Value
End If
Next cell
If Len(buf) > 0 Then MsgBox "Hi Hiren," & vbNewLine & "Today is " & Date & " and the item(s) due are:" & vbLf & buf
End With
End Sub