Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
I am new to excel, I have created a master worksheet, i want to copy that entire worksheet with its formatting to a new worksheet with a different name, can anyone help me out |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Dec 4, 9:59 am, Vimal Lalla
wrote: Hi I am new to excel, I have created a master worksheet, i want to copy that entire worksheet with its formatting to a new worksheet with a different name, can anyone help me out Hi Right click the worksheet tab at the bottom. You will see a menu item for Move or Copy...Click that and in the dialog box click on (move to end) and click the box for Create Copy. Now right click the worksheet tab for the copied sheet and click Rename - then type the new name. I'm assuming by new that you really mean new, and don't want this done using VBA. regards Paul |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
thanks for your reply, i need it done using vba " wrote: On Dec 4, 9:59 am, Vimal Lalla wrote: Hi I am new to excel, I have created a master worksheet, i want to copy that entire worksheet with its formatting to a new worksheet with a different name, can anyone help me out Hi Right click the worksheet tab at the bottom. You will see a menu item for Move or Copy...Click that and in the dialog box click on (move to end) and click the box for Create Copy. Now right click the worksheet tab for the copied sheet and click Rename - then type the new name. I'm assuming by new that you really mean new, and don't want this done using VBA. regards Paul |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Add following to standard vba module.
Code should copy activesheet & rename it to that entered in the inputbox. If duplicate name found an error will be reported. Hope helpful Sub CopySheet() Dim ShName As Variant TOP: ShName = Application.InputBox(prompt:="Enter New Name", Title:="Rename Worksheet", Type:=2) If VarType(ShName) = vbBoolean Then If ShName = False Then Debug.Print "cancelled" Exit Sub End If End If On Error Resume Next If Worksheets(ShName) Is Nothing Then With ActiveSheet .Copy after:=Sheets(.Index) End With ActiveSheet.Name = StrConv(ShName, vbProperCase) Else MsgBox ShName & " Sheet Already Exists" GoTo TOP End If End Sub -- JB "Vimal Lalla" wrote: Hi I am new to excel, I have created a master worksheet, i want to copy that entire worksheet with its formatting to a new worksheet with a different name, can anyone help me out |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks John for all your help
That works. "john" wrote: Add following to standard vba module. Code should copy activesheet & rename it to that entered in the inputbox. If duplicate name found an error will be reported. Hope helpful Sub CopySheet() Dim ShName As Variant TOP: ShName = Application.InputBox(prompt:="Enter New Name", Title:="Rename Worksheet", Type:=2) If VarType(ShName) = vbBoolean Then If ShName = False Then Debug.Print "cancelled" Exit Sub End If End If On Error Resume Next If Worksheets(ShName) Is Nothing Then With ActiveSheet .Copy after:=Sheets(.Index) End With ActiveSheet.Name = StrConv(ShName, vbProperCase) Else MsgBox ShName & " Sheet Already Exists" GoTo TOP End If End Sub -- JB "Vimal Lalla" wrote: Hi I am new to excel, I have created a master worksheet, i want to copy that entire worksheet with its formatting to a new worksheet with a different name, can anyone help me out |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
i have placed a button on the master page, when i click the button, it
creates the new sheet as i want it to, but it also copies the button, is there a way to exclude that. "Vimal Lalla" wrote: Hi I am new to excel, I have created a master worksheet, i want to copy that entire worksheet with its formatting to a new worksheet with a different name, can anyone help me out |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Dec 4, 11:11 am, Vimal Lalla
wrote: i have placed a button on the master page, when i click the button, it creates the new sheet as i want it to, but it also copies the button, is there a way to exclude that. "Vimal Lalla" wrote: Hi I am new to excel, I have created a master worksheet, i want to copy that entire worksheet with its formatting to a new worksheet with a different name, can anyone help me out- Hide quoted text - - Show quoted text - Hi Dim SheetButton as Button for each SheetButton in ActiveSheet.Buttons SheetButton.delete next SheetButton insert the loop after the copy regards Paul |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Paul's solution perfectly ok - but if you are only adding 1 button to master
sheet you only need simple change to code: Sub CopySheet() Dim ShName As Variant TOP: ShName = Application.InputBox(prompt:="Enter New Name", Title:="Rename Worksheet", Type:=2) If VarType(ShName) = vbBoolean Then If ShName = False Then Debug.Print "cancelled" Exit Sub End If End If On Error Resume Next If Worksheets(ShName) Is Nothing Then With ActiveSheet .Copy after:=Sheets(.Index) End With With ActiveSheet .Name = StrConv(ShName, vbProperCase) .Buttons(1).Delete End With Else MsgBox ShName & " Sheet Already Exists" GoTo TOP End If End Sub Hope helpful -- JB "Vimal Lalla" wrote: i have placed a button on the master page, when i click the button, it creates the new sheet as i want it to, but it also copies the button, is there a way to exclude that. "Vimal Lalla" wrote: Hi I am new to excel, I have created a master worksheet, i want to copy that entire worksheet with its formatting to a new worksheet with a different name, can anyone help me out |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Coping formulas | New Users to Excel | |||
need help with coping rows | Excel Worksheet Functions | |||
coping formula | New Users to Excel | |||
I need shortcut in Excel for coping text only and not the entire c | Excel Discussion (Misc queries) | |||
coping | New Users to Excel |