Dim ws As Worksheet Set ws = ThisWorkbook.Sheets("Sheet1") ' Change "Sheet1" to your sheet name ws.Columns.AutoFit ' Define an array of column headers Dim headers As Variant headers = Array("Header1", "Header2", "Header3", "Header4") ' Add your column names here ' Loop through the array and write headers in the first row For i = LBound(headers) To UBound(headers) ws.Cells(1, i + 1).Value = headers(i) Next i End Sub