I am writing below macros to show which row in which column is blank in alert box but there may be many cells can be empty so user keep clicking on alert box , how can i show it as a report in other sheet which row which column is empty ?
Sub Loop_Column_Row()
Dim lRow, lCol As Long
'Find the last non-blank cell in row 1
'This assumes that the first row has column headers
lCol = Cells(1, Columns.Count).End(xlToLeft).Column
'Loop through columns
For x = 1 To lCol
'Find the last non-blank cell in the column
lRow = Cells(Rows.Count, x).End(xlUp).Row
'Loop through rows
'Start from row 2 as row 1 is the row with headers
For y = 2 To lRow
If Cells(y, x) = "" Then
'Display message box when empty cell is found
MsgBox "Cell in Row: " & y & " Column: " & x & " is empty"
'Stop executing the method when 1st empty cell found
Exit Sub
End If
Next y
Next x
End Sub
Bookmarks