Hi is this possible to get column header name instead of column numeric valueusing VBA in below sample code.![]()
Column: " & x &
![]()
Sub Loop_Column_Row() Dim lRow, lCol As Long 'Counter Dim i As Integer 'Find the last non-blank cell in row 1 'This assumes that the first 5 row has column headers lCol = Cells(6, Columns.Count).End(xlToLeft).Column i = 1 '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 = 6 To lRow If Cells(y, x) = "" Then 'Write in column A of Sheet3 ThisWorkbook.Worksheets("Sheet3").Range("A" & i).Value = "Cell in Row: " & y & " Column: " & x & " is empty" i = i + 1 End If Next y Next x End Sub
Bookmarks