I have two worksheets that each need different headers added to row. When I use this:
Dim headers() As Variant
Dim wb As Workbook
Application.ScreenUpdating = False 'turn this off for the macro to run a little faster
ActiveWorkbook.Worksheets("AnalysisEnd").Select
Set wb = ActiveWorkbook
headers() = Array("Merge Cells", "Site", "Ins. Co.", "Chg Amt", "Pay Amt", "Adj Amt", _
"Ref Amt", "Bal Amt", "Amount Billed", "CA%")
With ws
.rows(5).Value = "" 'This will clear out row 5
For i = LBound(headers()) To UBound(headers())
.Cells(5, 1 + i).Value = headers(i)
Next i
.rows(5).Font.Bold = True
.rows(5).Font.ColorIndex = 50
End With
It gives all my sheets the same header rows.
Dim headers() As Variant
Dim wb As Workbook
Application.ScreenUpdating = False 'turn this off for the macro to run a little faster
ActiveWorkbook.Worksheets("AnalysisEnd").Select
Set wb = ActiveWorkbook
headers() = Array("Merge Cells", "Site", "Ins. Co.", "Chg Amt", "Pay Amt", "Adj Amt", _
"Ref Amt", "Bal Amt", "Amount Billed", "CA%")
With ws
.rows(5).Value = "" 'This will clear out row 5
For i = LBound(headers()) To UBound(headers())
.Cells(5, 1 + i).Value = headers(i)
Next i
.rows(5).Font.Bold = True
.rows(5).Font.ColorIndex = 50
End With
It gives all my sheets the same header rows.