Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default coping a entire tab to a new tab

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 789
Default coping a entire tab to a new tab

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default coping a entire tab to a new tab

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,069
Default coping a entire tab to a new tab

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default coping a entire tab to a new tab

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default coping a entire tab to a new tab

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 789
Default coping a entire tab to a new tab

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,069
Default coping a entire tab to a new tab

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Coping formulas carper1975 New Users to Excel 2 June 18th 09 09:15 PM
need help with coping rows Emac39 Excel Worksheet Functions 0 December 11th 08 02:28 AM
coping formula Darts via OfficeKB.com New Users to Excel 2 March 28th 08 12:56 PM
I need shortcut in Excel for coping text only and not the entire c UABCSA Excel Discussion (Misc queries) 4 April 14th 05 01:58 AM
coping ben kiser New Users to Excel 1 April 11th 05 01:41 PM


All times are GMT +1. The time now is 11:51 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"