Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Annepaws
 
Posts: n/a
Default Print multiple pages with different name.

I have set up a timesheet in excel that I would like to be able to print with
each employees name on it. Is there a way of doing this without creating a
sheet for each employee.
  #2   Report Post  
Dave Peterson
 
Posts: n/a
Default

Say you put the names of the employees on Sheet2 (a1:Axxx). And you want to
print Sheet1 (and the names go into C1). Then you could run a little macro to
print:

Option Explicit
Sub testme01()

Dim myCell As Range
Dim myNamesRng As Range
Dim myHeaderCell As Range

With Worksheets("sheet2")
Set myNamesRng = .Range("a1", .Cells(.Rows.Count, "A").End(xlUp))
End With

With Worksheets("sheet1")
Set myHeaderCell = .Range("C1")

For Each myCell In myNamesRng.Cells
myHeaderCell.Value = myCell.Value
.PrintOut preview:=True
Next myCell

myHeaderCell.ClearContents

End With

End Sub

(I used preview:=true to save paper while testing.)

If you're new to macros, you may want to read David's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

Annepaws wrote:

I have set up a timesheet in excel that I would like to be able to print with
each employees name on it. Is there a way of doing this without creating a
sheet for each employee.


--

Dave Peterson
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
Print all charts in a workbook (multiple worksheets) aewsaws Charts and Charting in Excel 4 May 12th 23 03:45 AM
print different row titles in one sheet w/ many pages Carman Law Excel Worksheet Functions 2 May 24th 05 12:08 PM
Print multiple pages per Sheet in Excel 2003 Chris N Excel Discussion (Misc queries) 1 May 4th 05 03:17 AM
How do you set titles to print on multiple pages? Enoira Excel Discussion (Misc queries) 1 May 2nd 05 11:31 PM
set the print area print multiple tabs veng Excel Discussion (Misc queries) 5 February 12th 05 07:01 PM


All times are GMT +1. The time now is 10:38 PM.

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

About Us

"It's about Microsoft Excel"