Hello, hope everyone is doing OK. I have been using Microsoft office products for years now. I've only recently discovered however, macros and some of the other "behind the scene" tools available. What I could use a hand with is this; with the help of my son, I have recoded a macro that records the formatting (column width, row height, borders, etc...) from my first worksheet, (I'll call it template) opens a new ws (ws1), and applies said formatting to it. Love that function. The code I want to add is; after creating the new ws1 I would like to have ws1 look at its own cell A1 and rename the worksheet to whatever is in ws1, A1. Then if I use the macro to create another ws(2), I would like the new ws2 to look at its A1 and rename ws2, to what's in ws2, A1. Etc... I will post the code in this thread to show you the macro I've already recorded. I'm hoping to somehow add the code in here somewhere so that the newly created ws will get its name from its own cell A1.
"
Sub Apply_formatting()
'
' Apply_formatting Macro
'
' Keyboard Shortcut: Ctrl+m
'
Cells.Select
Selection.Copy
Sheets.Add After:=Sheets(Sheets.Count)
Cells.Select
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False
End Sub
"
Thank you in advance, and thanks for tolerating my ignorance. (Remember, the difference between ignorance and stupidity; Ignorance is: Having never seen a crocodile before in your life, you reach out to pet it because it's so cute. Stupidity is then offering it your remaining hand)
"
Sub Apply_formatting()
'
' Apply_formatting Macro
'
' Keyboard Shortcut: Ctrl+m
'
Cells.Select
Selection.Copy
Sheets.Add After:=Sheets(Sheets.Count)
Cells.Select
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False
End Sub
"
Thank you in advance, and thanks for tolerating my ignorance. (Remember, the difference between ignorance and stupidity; Ignorance is: Having never seen a crocodile before in your life, you reach out to pet it because it's so cute. Stupidity is then offering it your remaining hand)