Hi
I have started writing a macro with the code as follows:
Option Explicit
Dim Template As ThisWorkbook
Dim month1, month2, month3 As Worksheet
Dim HHH, DDD, TTT As Worksheet
Dim FilePath As String
Dim File As Workbook
Sub PA()
Set Template = ThisWorkbook
Set month1 = Template.Sheets(1)
Set month2 = Template.Sheets(2)
Set month3 = Template.Sheets(3)
Set HHH = Template.Sheets(4)
Set DDD = Template.Sheets(5)
Set TTT = Template.Sheets(6)
month1.Name = month1.Range("B1").Text
month2.Name = month1.Range("C1").Text
month3.Name = month1.Range("D1").Text
'-----------------------------------------------------------------------------
FilePath = "F:\xxx\xxxxx\"
Set File = Workbooks.Open(FilePath & "File.xlsm")
'-----------------------------------------------------------------------------
Let's say sheets 1-3 in the Template workbook have been renamed Jan-17, Feb-17 & Mar-17. What I want to do is copy from the 'File' workbook the macro has opened the tabs which match the names of these tabs (i.e. Jan-17 etc.) and paste in to a cell (let's say A4) of the respective tabs of the Template workbook. This is a template so the names the tabs will change whenever the macro is run.
I hope this makes sense.
Thanks in advance
Bookmarks