#1   Report Post  
kwedde01
 
Posts: n/a
Default 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

  #2   Report Post  
Rowan
 
Posts: n/a
Default

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro printing to a file RG Excel Discussion (Misc queries) 4 July 22nd 05 02:19 PM
Help with macro looping and color query function kevinm Excel Discussion (Misc queries) 10 May 26th 05 01:25 AM
Playing a macro from another workbook Jim Excel Discussion (Misc queries) 1 February 23rd 05 10:12 PM
Date macro Hiking Excel Discussion (Misc queries) 9 February 3rd 05 12:40 AM
Macro and If Statement SATB Excel Discussion (Misc queries) 2 December 3rd 04 04:46 PM


All times are GMT +1. The time now is 05:24 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"