Duplicate sheet 1 within same workbook

amzma

New Member
Joined
Jul 1, 2016
Messages
10
Hi there

I have an excel document that I am creating sales invoices in, I need to create the invoice a few times (customer copy, delivery note, our copy, export copy).

At the moment I enter the data on sheet one (customer) and it automatically copies across to the other sheets but it loses all the formatting that I do (bold, italic), is there anyway of copying it across but keeping the formating?

Thanks.
Amy
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
like this?

Code:
Sub Duplicate()
Dim wsSrc As Worksheet
Set wsSrc = ActiveSheet
    wsSrc.Copy After:=Sheets(Sheets.Count)
    ActiveSheet.Name = "customer copy"

    wsSrc.Copy After:=Sheets(Sheets.Count)
    ActiveSheet.Name = "delivery copy"
  
    wsSrc.Copy After:=Sheets(Sheets.Count)
    ActiveSheet.Name = "Export copy"
Set wsSrc = Nothing
End Sub
 
Upvote 0
like this?

Code:
Sub Duplicate()
Dim wsSrc As Worksheet
Set wsSrc = ActiveSheet
    wsSrc.Copy After:=Sheets(Sheets.Count)
    ActiveSheet.Name = "customer copy"

    wsSrc.Copy After:=Sheets(Sheets.Count)
    ActiveSheet.Name = "delivery copy"
 
    wsSrc.Copy After:=Sheets(Sheets.Count)
    ActiveSheet.Name = "Export copy"
Set wsSrc = Nothing
End Sub
Hi ranman256, thanks for your quick reply!
Where abouts do I post this code? in the VBA of the customer worksheet?
 
Upvote 0
like this?

Code:
Sub Duplicate()
Dim wsSrc As Worksheet
Set wsSrc = ActiveSheet
    wsSrc.Copy After:=Sheets(Sheets.Count)
    ActiveSheet.Name = "customer copy"

    wsSrc.Copy After:=Sheets(Sheets.Count)
    ActiveSheet.Name = "delivery copy"
 
    wsSrc.Copy After:=Sheets(Sheets.Count)
    ActiveSheet.Name = "Export copy"
Set wsSrc = Nothing
End Sub
Hi again!
I have made a button with this code in the customer copy and when pressed it generates the extra worksheets nicely but I need to amend the other copies slighlty, like the delivery copy shouldnt have any prices detailed on it like the other copies..

At the moment I am using this formula in the cells of my old invoice that is copying the data across but without formatting
=IF('Red - A'!C28= ISBLANK(TRUE), " ", 'Red - A'!C28) ** red is the customer copy
 
Upvote 0

Forum statistics

Threads
1,215,035
Messages
6,122,785
Members
449,095
Latest member
m_smith_solihull

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top