ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Printing Macro (https://www.excelbanter.com/excel-discussion-misc-queries/30056-printing-macro.html)

kwedde01

Printing Macro
 

--------------------------------------------------------------------------------

I am working on a new project. I have 25 worksheets within the the
workbook. Each is named differently. I would like to be able to create
a macro which will determine how many pages to be printed for each
worksheet, and for every new page within that worksheet, for it to copy
from the first page cells A1:E6 (which contains the heading of the
tables) and them those headings in cells A1:E6 of the following page,
without deleting the information which begins on the new page. Also
then insert page numbers on each page.

Also how do I write a macro which will select all worksheets and
password protect/unprotect multiple sheets at once. typing in a
password for 25 or more individual sheets is a daunting task

Can someone help me please.


--
kwedde01
------------------------------------------------------------------------
kwedde01's Profile: http://www.excelforum.com/member.php...o&userid=24156
View this thread: http://www.excelforum.com/showthread...hreadid=377934


Rowan

You don't need a macro to achieve your printing requirements.
Goto FilePage Setup. On the Page tab enter Auto in the First page number
field.
On the Header/Footer tab add a Page number to the footer (select an option
from the dropdown or use the Custom Footer button).
On the Sheet tab enter $1:$6 in the Rows to Repeat At Top field.

With regards to protecting/unprotecting sheets try something like:

Sub Protect()
Dim sht As Worksheet
For Each sht In Worksheets
sht.Protect Password:="mypassword"
Next sht
End Sub

Sub UnProtect()
Application.ScreenUpdating = False
Dim sht As Worksheet
For Each sht In Worksheets
sht.UnProtect Password:="mypassword"
Next sht
Application.ScreenUpdating = True
End Sub

Edit the password to be relevant to you.

Hope this helps
Rowan

"kwedde01" wrote:


--------------------------------------------------------------------------------

I am working on a new project. I have 25 worksheets within the the
workbook. Each is named differently. I would like to be able to create
a macro which will determine how many pages to be printed for each
worksheet, and for every new page within that worksheet, for it to copy
from the first page cells A1:E6 (which contains the heading of the
tables) and them those headings in cells A1:E6 of the following page,
without deleting the information which begins on the new page. Also
then insert page numbers on each page.

Also how do I write a macro which will select all worksheets and
password protect/unprotect multiple sheets at once. typing in a
password for 25 or more individual sheets is a daunting task

Can someone help me please.


--
kwedde01
------------------------------------------------------------------------
kwedde01's Profile: http://www.excelforum.com/member.php...o&userid=24156
View this thread: http://www.excelforum.com/showthread...hreadid=377934




All times are GMT +1. The time now is 02:33 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com