This is my Issue:
I have a Macro that creates Worksheets and names them, names are taken from a Pre-Defined Range list in a specific worksheet called Setup.
That macro works perfectly.
___________________________
Sub CreateSheets()
Dim MyCell As Range, MyRange As Range
Set MyRange = Sheets("Setup").Range("B5:B24")
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
Sheets("Setup").Select
End Sub
____________________________
Now I need to insert the name of the Worksheet, to a cell in the corresponding Worksheet using a Macro that I might use, "ALSO", to Format the cell later. obviously, I would like to get the name directly from the list where i created the worksheets.
Here is my problem, I get the correct data enter, but only on the last worksheet. I have not been able to figure out how to reset the values of my counter (if that is the problem).
Any help is appreciated.
____________________________
Sub HeadingInfo()
Dim MyCell As Range
Dim MyRange As Range
Set MyRange = Sheets("Setup").Range("B5:B24")
Set MyRange = Range(MyRange, MyRange.End(xlDown))
For Each MyCell In MyRange
Sheets(Sheets.Count).Select
Range("B2").Select
ActiveCell.FormulaR1C1 = MyCell.Value
Next MyCell
End Sub
____________________________
See image
https://1drv.ms/u/s!AifnZW4FDVY36HBCCy7C4-4Zc3NE
or Download the file
https://1drv.ms/x/s!AifnZW4FDVY36HHGSLnw-cjJlJTu
I have a Macro that creates Worksheets and names them, names are taken from a Pre-Defined Range list in a specific worksheet called Setup.
That macro works perfectly.
___________________________
Sub CreateSheets()
Dim MyCell As Range, MyRange As Range
Set MyRange = Sheets("Setup").Range("B5:B24")
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
Sheets("Setup").Select
End Sub
____________________________
Now I need to insert the name of the Worksheet, to a cell in the corresponding Worksheet using a Macro that I might use, "ALSO", to Format the cell later. obviously, I would like to get the name directly from the list where i created the worksheets.
Here is my problem, I get the correct data enter, but only on the last worksheet. I have not been able to figure out how to reset the values of my counter (if that is the problem).
Any help is appreciated.
____________________________
Sub HeadingInfo()
Dim MyCell As Range
Dim MyRange As Range
Set MyRange = Sheets("Setup").Range("B5:B24")
Set MyRange = Range(MyRange, MyRange.End(xlDown))
For Each MyCell In MyRange
Sheets(Sheets.Count).Select
Range("B2").Select
ActiveCell.FormulaR1C1 = MyCell.Value
Next MyCell
End Sub
____________________________
See image
https://1drv.ms/u/s!AifnZW4FDVY36HBCCy7C4-4Zc3NE
or Download the file
https://1drv.ms/x/s!AifnZW4FDVY36HHGSLnw-cjJlJTu