VBA learner ITG
Active Member
- Joined
- Apr 18, 2017
- Messages
- 272
- Office Version
- 365
- Platform
- Windows
- MacOS
I hope everyone is having a nice day.
I was wondering if i could get your advice i have a tab called template which i want to copy into all 300 tabs in the workbook.
Each of the 300 tabs is called something different.
My Q. is there a VBA code that would do this.
1. Copy the tab data from Template straight into each tabs.
For your reference:
I have the below code which is being used to create the 300 odd tabs.
I hope this can be done as part of this code or as a seperate VBA code to be run.
Sub Create_Tabs()
Dim MyCell As Range, MyRange As Range
Set MyRange = Sheets("For Curve Analysis").Range("B2")
Set MyRange = Range(MyRange, MyRange.End(xlDown))
For Each MyCell In MyRange
Sheets.Add After:=Sheets(Sheets.Count) 'creates a new worksheet
Sheets(Sheets.Count).Name = MyCell.Value ' renames the new worksheet
Sheets("Template ").Select
Cells.Select
Selection.Copy
ActiveSheet.Paste
Next MyCell
End Sub
I was wondering if i could get your advice i have a tab called template which i want to copy into all 300 tabs in the workbook.
Each of the 300 tabs is called something different.
My Q. is there a VBA code that would do this.
1. Copy the tab data from Template straight into each tabs.
For your reference:
I have the below code which is being used to create the 300 odd tabs.
I hope this can be done as part of this code or as a seperate VBA code to be run.
Sub Create_Tabs()
Dim MyCell As Range, MyRange As Range
Set MyRange = Sheets("For Curve Analysis").Range("B2")
Set MyRange = Range(MyRange, MyRange.End(xlDown))
For Each MyCell In MyRange
Sheets.Add After:=Sheets(Sheets.Count) 'creates a new worksheet
Sheets(Sheets.Count).Name = MyCell.Value ' renames the new worksheet
Sheets("Template ").Select
Cells.Select
Selection.Copy
ActiveSheet.Paste
Next MyCell
End Sub