CuriousGeorg
11-13-2013, 05:04 AM
Good morning,
I have a msgbox appear on opening the worksheet if a task is due within 7 days.
Private Sub Workbook_Open()
Dim rngCell As Range
For Each rngCell In Application.Intersect(Range("F6:F" & Rows.Count), Range("F6").CurrentRegion)
If rngCell.Value <= 7 Then
MsgBox "TASK DUE " & vbLf & vbLf & _
"Task: " & Range("B" & rngCell.Row) & ". Who: " & Range("C" & rngCell.Row)
End If
Next rngCell
Set rngCell = Nothing
End Sub
Is there a way I can alter this code so that either:
a. it doesnt pop up if cell H says completed or
b. it doesnt pop up if date (days remaining) column is blank?
im thinking that it might be as simple as adding an "AND" for a range to the "if rngCell" line.. but i dont know
I have a msgbox appear on opening the worksheet if a task is due within 7 days.
Private Sub Workbook_Open()
Dim rngCell As Range
For Each rngCell In Application.Intersect(Range("F6:F" & Rows.Count), Range("F6").CurrentRegion)
If rngCell.Value <= 7 Then
MsgBox "TASK DUE " & vbLf & vbLf & _
"Task: " & Range("B" & rngCell.Row) & ". Who: " & Range("C" & rngCell.Row)
End If
Next rngCell
Set rngCell = Nothing
End Sub
Is there a way I can alter this code so that either:
a. it doesnt pop up if cell H says completed or
b. it doesnt pop up if date (days remaining) column is blank?
im thinking that it might be as simple as adding an "AND" for a range to the "if rngCell" line.. but i dont know