I want to a workbook "xyz", copy its header row (1st row) rom sheet1 and paste it to a different workbook's (mnp) sheet1 which is already opened.
Next open a workbook "pqr" and open a workbook from different folder path(abc) and paste it to header row (1st row). Each workbook has only one sheet.
I have written below codes,here i have to change the file name everytime and run it. Please assign a easy dynamic code.
Windows("XYZ.xlsx").Activate
Rows("1:1").Select
Selection.Copy
Application.WindowState = xlNormal
Windows("mnp.xlsx").Activate
Rows("1:1").Select
ActiveSheet.Paste
Windows("Book1").Activate