I tried just
Set rngArea = Application.Union(.Range(.Cells(2, "E"), .Cells(lngLast, "f")),.Range(.Cells(2, "H"), .Cells(lngLast, "H")))
but it failed on
If WorksheetFunction.CountBlank(rngArea) > 0
This works
Sub Andrei_2()
Dim lngLast As Long
Dim strMsg As String
Dim rngCell As Range
Dim rngArea As Range
With ActiveSheet
lngLast = .Cells(Rows.Count, "A").End(xlUp).Row
Set rngArea = Union(.Range(.Cells(2, "E"), .Cells(lngLast, "f")), .Range(.Cells(2, "h"), .Cells(lngLast, "h")))
For Each rngCell In rngArea
If rngCell.Value = vbNullString Then
strMsg = strMsg & rngCell.Address(0, 0) & vbNewLine
End If
Next rngCell
MsgBox "Please fill out the following cells:" & vbCrLf & strMsg & "and start macro again.", vbInformation
Exit Sub
End With
End Sub
Bookmarks