PC Review


Reply
Thread Tools Rate Thread

coping a entire tab to a new tab

 
 
Vimal Lalla
Guest
Posts: n/a
 
      4th Dec 2007
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 With Quote
 
 
 
 
paul.robinson@it-tallaght.ie
Guest
Posts: n/a
 
      4th Dec 2007
On Dec 4, 9:59 am, Vimal Lalla <VimalLa...@discussions.microsoft.com>
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
 
Reply With Quote
 
Vimal Lalla
Guest
Posts: n/a
 
      4th Dec 2007
Hi

thanks for your reply, i need it done using vba

"(E-Mail Removed)" wrote:

> On Dec 4, 9:59 am, Vimal Lalla <VimalLa...@discussions.microsoft.com>
> 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
>

 
Reply With Quote
 
john
Guest
Posts: n/a
 
      4th Dec 2007
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

 
Reply With Quote
 
Vimal Lalla
Guest
Posts: n/a
 
      4th Dec 2007
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

 
Reply With Quote
 
Vimal Lalla
Guest
Posts: n/a
 
      4th Dec 2007
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 With Quote
 
paul.robinson@it-tallaght.ie
Guest
Posts: n/a
 
      4th Dec 2007
On Dec 4, 11:11 am, Vimal Lalla <VimalLa...@discussions.microsoft.com>
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

 
Reply With Quote
 
john
Guest
Posts: n/a
 
      4th Dec 2007
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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: I need shortcut in Excel for coping text only and not the entire c Duke Carey Microsoft Excel Misc 0 14th Apr 2005 01:58 AM
Re: I need shortcut in Excel for coping text only and not the entire c Chip Pearson Microsoft Excel Misc 0 13th Apr 2005 03:28 PM
Re: I need shortcut in Excel for coping text only and not the entire c Peo Sjoblom Microsoft Excel Misc 0 13th Apr 2005 02:21 PM
How to avoid coping a link when coping a formula from another wor. =?Utf-8?B?Smlt?= Microsoft Excel Misc 0 20th Sep 2004 07:53 PM
Replica or coping the entire database ARMOUDIAN Microsoft Access External Data 0 4th Aug 2003 08:17 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:03 AM.