Vickytayade18
New Member
Hi Amigos,
Good day!
I have code attached.
but with this code i not getting the formatting of header cells, which i want in attached output file format.( Color )
I want exact header as attached in Output file.
Please can anyone help me to modify this code ?
Good day!
I have code attached.
Code:
Sub HTS_TEMPLATE()
Dim x As Worksheet, y As Worksheet, LastRow&
Workbooks.Open ("C:Source.xlsm")
'source file
ActiveWorkbook.SaveAs Filename:="C:Output template.xls"
'to add a new file as output file
Set x = Workbooks("Source.xlsm").Worksheets("Sheet1")
Set y = ActiveWorkbook.Worksheets("Sheet1")
LastRow = x.Cells.SpecialCells(xlCellTypeLastCell).Row
x.Range("A1:A" & LastRow).Copy y.Cells(Rows.Count, "A").End(xlUp).Offset(1, 0)
x.Range("B1:B" & LastRow).Copy y.Cells(Rows.Count, "E").End(xlUp).Offset(1, 0)
x.Range("H1:H" & LastRow).Copy y.Cells(Rows.Count, "H").End(xlUp).Offset(1, 0)
x.Range("I1:I" & LastRow).Copy y.Cells(Rows.Count, "I").End(xlUp).Offset(1, 0)
Application.CutCopyMode = False
End Sub
but with this code i not getting the formatting of header cells, which i want in attached output file format.( Color )
I want exact header as attached in Output file.
Please can anyone help me to modify this code ?
Attachments
Last edited: