I am trying to write an IsEmpty
code to check if there are any empty cells in a certain selection range. The thing is it cannot be hard-coded such as B100:J
because I am importing data constantly so the data range will constantly change and never be the same. So, before I make the excel a PDF via Macro, I want to check all the cells to see if there is an empty cell, therefore I can delete it or make adjustments to it.
The code below is what I have so far, but it doesn't run and I am kind of stuck, anything helps! The reason I have B15:J15
is it because that's where the data will start and end, but I will never know how long it will go down, it can go from B100:J100
or B30:J30
.
Thanks, everyone.
Sub IsEmpty()
'check to see if there are any blank cells before archiving
Dim N As Range
Set N = Range("B15:J15").End(xlDown)
If IsEmpty(Range(N).Value) = False Then
MsgBox ("Blank information, please double check")
End If
End Sub