Hello Forum,
I have a worksheet with values from column A to AK, and an undetermined number of rows yet.
I need a code to do this : loop through columns B to AK, and, for each cell containing the value 1, then replace 1 with the header of the column in which the cell containing 1 is... (Headers are on the first row).
I know how to do so but only with one column. Can you help me improve my code?
Thank you so much in advance.
![]()
Sub Loop_Column() Dim rngCell As Range For Each rngCell In ActiveSheet.Range("d:d") If rngCell.Value = 1 Then rngCell.Value = Range("d1").Value End If Next rngCell End Sub
Bookmarks