Trying to create a macro that will add 2 new columns A & B with headers to each sheet in workbook.
This code works to add columns for all worksheets, but only puts the headers in the 1st worksheet.
Sub Insert_Columns()
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
On Error Resume Next
ws.[a:b].Insert
Range("A1").Select
ActiveCell.FormulaR1C1 = "Date Deleted: After Master Tab is Created"
Range("B1").Select
ActiveCell.FormulaR1C1 = "Date Added: After Master Tab is Created"
Next ws
End Sub
This code works to add columns for all worksheets, but only puts the headers in the 1st worksheet.
Sub Insert_Columns()
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
On Error Resume Next
ws.[a:b].Insert
Range("A1").Select
ActiveCell.FormulaR1C1 = "Date Deleted: After Master Tab is Created"
Range("B1").Select
ActiveCell.FormulaR1C1 = "Date Added: After Master Tab is Created"
Next ws
End Sub