Hi,
I would like to autofill horizontally in order to create headers in the first row for all the columns in the used range.
With my macro the autofill only stretches to the column in which in the first row a value is displayed. I would like to autofill horizontally for all the columns in the used range, so also for columns that have values in other rows than the second. So the headers should be "header 1", "header 2", etc.
How can this be done?
Sub invoegen_kopteksten() 'voegt kopteksten "Waarde1" , etc. toe aan de kolommen
[d1] = "header 1"
Cells(1, 4).AutoFill Destination:=Range(Cells(1, 4), Cells(1, Cells(4, Columns.Count).End(xlToLeft).Column))
End Sub
Bookmarks