barim
05-22-2019, 11:34 AM
I have this piece of code that I would like to improve. There must be a better way to do it.
Appreciate any help on this.
Thanks.
ActiveSheet.Copy After:=Sheets(Sheets.Count)
ActiveSheet.Name = "Products1"
Columns(1).EntireColumn.Insert
Columns(1).Cells(1, 1).Value = "ID"
Columns(7).Cells(1, 1).Value = "Column1"
Columns(7).Cells(1, 1).Interior.ColorIndex = 27
Columns(7).Cells(1, 1).Font.Bold = True
Columns(8).Cells(1, 1).Value = "Column2"
Columns(8).Cells(1, 1).Interior.ColorIndex = 27
Columns(8).Cells(1, 1).Font.Bold = True
Columns(9).Cells(1, 1).Value = "Column3"
Columns(9).Cells(1, 1).Interior.ColorIndex = 27
Columns(9).Cells(1, 1).Font.Bold = True
Columns(10).Cells(1, 1).Value = "Column4"
Columns(10).Cells(1, 1).Interior.ColorIndex = 27
Columns(10).Cells(1, 1).Font.Bold = True
Columns(11).Cells(1, 1).Value = "Column5"
Columns(11).Cells(1, 1).Interior.ColorIndex = 27
Columns(11).Cells(1, 1).Font.Bold = True
Columns(12).Cells(1, 1).Value = "Date"
Columns(12).Cells(1, 1).Interior.ColorIndex = 27
Columns(12).Cells(1, 1).Font.Bold = True
Columns(12).Cells(2, 1).Value = Format(Now(), "mm/dd/yyyy")
Appreciate any help on this.
Thanks.
ActiveSheet.Copy After:=Sheets(Sheets.Count)
ActiveSheet.Name = "Products1"
Columns(1).EntireColumn.Insert
Columns(1).Cells(1, 1).Value = "ID"
Columns(7).Cells(1, 1).Value = "Column1"
Columns(7).Cells(1, 1).Interior.ColorIndex = 27
Columns(7).Cells(1, 1).Font.Bold = True
Columns(8).Cells(1, 1).Value = "Column2"
Columns(8).Cells(1, 1).Interior.ColorIndex = 27
Columns(8).Cells(1, 1).Font.Bold = True
Columns(9).Cells(1, 1).Value = "Column3"
Columns(9).Cells(1, 1).Interior.ColorIndex = 27
Columns(9).Cells(1, 1).Font.Bold = True
Columns(10).Cells(1, 1).Value = "Column4"
Columns(10).Cells(1, 1).Interior.ColorIndex = 27
Columns(10).Cells(1, 1).Font.Bold = True
Columns(11).Cells(1, 1).Value = "Column5"
Columns(11).Cells(1, 1).Interior.ColorIndex = 27
Columns(11).Cells(1, 1).Font.Bold = True
Columns(12).Cells(1, 1).Value = "Date"
Columns(12).Cells(1, 1).Interior.ColorIndex = 27
Columns(12).Cells(1, 1).Font.Bold = True
Columns(12).Cells(2, 1).Value = Format(Now(), "mm/dd/yyyy")