Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]() -------------------------------------------------------------------------------- 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 |
#2
![]() |
|||
|
|||
![]()
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro printing to a file | Excel Discussion (Misc queries) | |||
Help with macro looping and color query function | Excel Discussion (Misc queries) | |||
Playing a macro from another workbook | Excel Discussion (Misc queries) | |||
Date macro | Excel Discussion (Misc queries) | |||
Macro and If Statement | Excel Discussion (Misc queries) |