How to print 3 copies of one worksheet with different headers?

1234_a

New Member
Joined
Mar 11, 2020
Messages
9
Office Version
  1. 2016
Platform
  1. Windows
Hello!
I have a problem which I don't know how to solve.
So, I have a one worksheet where is information which I need to print, but I need three copies of this sheet and for all of them I need different header:
1) Copy for me
2) Copy for company
3) Copy for accounting.

The main thing is that I need to click button print and it is printing 3 copies with different headers! I hope that someone will help me!
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
Try this macro replacing the text in red to suit your needs:
Rich (BB code):
Sub InsertHeaderFooter()
    Application.ScreenUpdating = False
    Dim arr As Variant, i As Long
    arr = Array("Me", "Company", "Accounting")
    For i = LBound(arr) To UBound(arr)
        With ActiveSheet
            .PageSetup.CenterHeader = arr(i)
            .PrintOut
        End With
    Next i
    Application.ScreenUpdating = True
End Sub
 
Upvote 0
Sub InsertHeaderFooter() Application.ScreenUpdating = False Dim arr As Variant, i As Long arr = Array("Me", "Company", "Accounting") For i = LBound(arr) To UBound(arr) With ActiveSheet .PageSetup.CenterHeader = arr(i) .PrintOut End With Next i Application.ScreenUpdating = True End Sub
Thank you, but after I enter your code and press "run", the code want to save these copies, but I need like that - when I click "print" it just print me 3 copies with different headers.
 
Upvote 0
Do you have a "print" button on your sheet that you click? I tested the macro and it works properly.
No, I don't have a "print" button. I need it? If I need it, could you explain me how to get it?
 
Upvote 0
No you don't need it. All you have to do is place the macro in a regular module and run it.
 
Upvote 0

Forum statistics

Threads
1,214,952
Messages
6,122,458
Members
449,085
Latest member
ExcelError

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