Q:

VBA check entire range has valid date and is not blank?

I have a workbook like so:

Dates
01/02/2017
01/03/2017
BLANK
01/02/2017

I am trying to run a macro but only if all cells in my range are valid dates and not empty.
I am using the below:
Dim cell As Range

    'With my workbook, lets check the data
    With wb.Worksheets(1)
    Lastrow = .Cells(.Rows.count, "G").End(xlUp).Row

    'Data Check: Are all dates valid?
    For Each cell In Range("E9:E" & Lastrow)
    If IsDate(cell.Value) And Not IsEmpty(cell.Value) Then
    Continue
    Else
    Exit Sub

    End If
    Next
    End With

But this is not working. The macro still runs no matter what! If it matters my cells in this column Are data validation lists.
Please can someone show me where i am going wrong?

A:

Reverse the logic a bit:
    Dim cell As Range

    'With my workbook, lets check the data
    With wb.Worksheets(1)
        Lastrow = .Cells(.Rows.Count, "G").End(xlUp).Row

        'Data Check: Are all dates valid?
        For Each cell In Range("E9:E" & Lastrow)
            If Not IsDate(cell.Value) Or Trim(cell.Value) = "" Then
                Exit Sub
            End If
        Next
        ' the rest of your code.
        ' it will not get here if there are any blanks in or non dates in the range.

    End With

