`Hello, I was trying to create a new sheet using a `command button` and a `message box` with the same format and formulas as the sheet before, with the `command button` at the same place as the previous sheet (to allow myself to create a new sheet in the future using this one), however i cannot seem to find a way to get the `command button` to be in the new sheet.
Sub ADD_sheet()
Dim ws As Worksheet
Dim wsNew As Worksheet
Dim strName As String Set
ws = ActiveSheet
strName = InputBox("enter new sheet name")
Set wsNew = Sheets.Add(After:=Sheets(Sheets.Count))
wsNew.Name = strName
ws.UsedRange.Copy
wsNew.Range("A1").PasteSpecial xlPasteFormulas
wsNew.Range("A1").PasteSpecial xlPasteFormats
Application.CutCopyMode = False`
End sub
should i add something to the code or is there another solution that can solve this issue ?
Sub ADD_sheet()
Dim ws As Worksheet
Dim wsNew As Worksheet
Dim strName As String Set
ws = ActiveSheet
strName = InputBox("enter new sheet name")
Set wsNew = Sheets.Add(After:=Sheets(Sheets.Count))
wsNew.Name = strName
ws.UsedRange.Copy
wsNew.Range("A1").PasteSpecial xlPasteFormulas
wsNew.Range("A1").PasteSpecial xlPasteFormats
Application.CutCopyMode = False`
End sub
should i add something to the code or is there another solution that can solve this issue ?