VBA Assistance - Excel

Closed
Royle1979 Posts 1 Registration date Tuesday November 15, 2016 Status Member Last seen November 15, 2016 - Nov 15, 2016 at 09:56 AM
yg_be Posts 23405 Registration date Sunday June 8, 2008 Status Contributor Last seen December 20, 2024 - Nov 17, 2016 at 04:04 PM
Hi,

I could really use some help. I currently run a monthly exercise through excel which is a bit laborious and time consuming due to the volume of cutting and pasting I have to do.

I am currently working with 2 tabs, one lists all the data I need to breakdown onto individual tabs ('Template'), this data will vary month by month and runs from A - P. The other (MASTER) is my list for the VBA below.

Sub CreateSheetsFromAList()
Dim MyCell As Range, MyRange As Range

Set MyRange = Sheets("Master").Range("A1")
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
Next MyCell
End Sub

My 'MASTER' list is used as the detail for the tab naming is duplicated on my 'Template' tab.

What I would like to do now is add all the detail relevant to the New Tab that has been created.

New Tab = Site A
Template = 'Site A' runs through cells A2 - A10, Duplicate detail also present in cells B2 - B10 i.e. '10' but all other cells in the range (C -P) contains unique data.

So I have 10 rows listed as SITE A where I want all details from A - P copied on to the new auto created tab.

I would also like to include the headers from my 'Template' on to each of the new worksheets, however this is small fry compared to what I wish to achieve above.

I do not come from a coding background but have an understanding of what I am looking at. Any assistance would be greatly appreciated.

Thanks,

Paul.
Related:

1 response

yg_be Posts 23405 Registration date Sunday June 8, 2008 Status Contributor Last seen December 20, 2024 5
Nov 17, 2016 at 04:04 PM
0