This macro looks for the last non-empty cell in column C, then selects the cell to left of it (column B).
I wanted the macro to then check if this neighboring cell is empty or not and display a message box if True, however when I run it the box never shows up.
When I replace the X in IsEmpty(X) to a regular cell location like IsEmpty(B22) it works fine. Reason why it has to be non-fix location is because the rest of the macro I'm making is combining rows from many workbooks into a master workbook so the last row location keeps moving down.
Thanks for the help.
Sub Sample()
Range("C1").Select
Selection.End(xlDown).Select
X = ActiveCell.Offset(0, -1).Select
' Test if the value in neighboring cell is blank/empty
If IsEmpty(X) = True Then
MsgBox "Cell is empty"
End If
End Sub
Bookmarks