Just trying to create a macro that runs when I open my workbook. I need it to check a date in a column(h) and return a pop up if the date is today or has gone past already.
I then need to check a column in the same workbook(i) to see if there has been another date entered and if there has to not display the first pop up.
I've managed to create the macro to make the pop up appear if the date has gone past, but I cannot get it to check the next column and not display the pop up if I have entered another date.
I've attempted to use an ElseIf statement, but I have probably used it in the wrong way.
I'm new to using VBA so any help would be greatly appreciated
Current Code:
Private Sub Autpen()
'Sets cell as Range
Dim cell As Range
'Checks Date in cell and gives pop up on Date past call date
For Each cell In Range("h3, h100")
If IsDate(cell.Value) Then
If cell.Value <= Now() Then
MsgBox "Call Required:" & cbCrLf & cell.Value & "; S/O# " & cell.Offset(0, -7).Value
End If
End If
Next cell
End Sub
I then need to check a column in the same workbook(i) to see if there has been another date entered and if there has to not display the first pop up.
I've managed to create the macro to make the pop up appear if the date has gone past, but I cannot get it to check the next column and not display the pop up if I have entered another date.
I've attempted to use an ElseIf statement, but I have probably used it in the wrong way.
I'm new to using VBA so any help would be greatly appreciated
Current Code:
Private Sub Autpen()
'Sets cell as Range
Dim cell As Range
'Checks Date in cell and gives pop up on Date past call date
For Each cell In Range("h3, h100")
If IsDate(cell.Value) Then
If cell.Value <= Now() Then
MsgBox "Call Required:" & cbCrLf & cell.Value & "; S/O# " & cell.Offset(0, -7).Value
End If
End If
Next cell
End Sub