I am trying to build a vba code. Some bits are working some not. Working: It is collecting valued cells from Customers workbook and pasting in new sheet in supplier workbook. New sheet is renamed on cell name. Not working: I also want to copy a header which is in Supplier workbook named as template. The last bit i want VBA code run through each column.
Sub Copy_Past_Repeat()
Dim rs As Worksheet
Dim rng As Range
Windows("Customer.xlsm").Activate
Set rng = Range("n1:n1000") 'column
rng.SpecialCells(xlCellTypeConstants).Select 'Selecting only hardcoded data
Selection.Copy
Windows("Supplier.xlsm").Activate
Sheets.Add after:=ActiveSheet
Range("C2").Select
ActiveSheet.Paste
ActiveSheet.Name = ActiveSheet.Range("C2")
'not working
ThisWorkbook.Sheets("Template").Range("A1:E1").Select
Selection.Copy
ActiveSheet.Paste 'should be pasted in just crated spreadsheet Name=(C2)
Application.CutCopyMode = False
End Sub `