Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 29
Default Macro for Print Program

Hi All:

I have a employee schedule in Excel that has names in Column A
(approximately 500 entries). I'd like to create a macro that could
print an individual page for each individual employee and place their
name in the header. Can you do this in Excel? or is this better
suited for Access?

Just curious if anyone has any experience with something like this.

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,123
Default Macro for Print Program

Hi Nimish

With names in A1: A10 try this

If it is working OK then change 10 to 500 and delete preview:=True

Sub PrintCopies_ActiveSheet()
Dim CopieNumber As Long

For CopieNumber = 1 To 10
With ActiveSheet
.PageSetup.LeftHeader = Cells(CopieNumber, "A").Value

'Print the sheet
.PrintOut preview:=True
End With
Next CopieNumber
End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl



"Nimish" wrote in message ups.com...
Hi All:

I have a employee schedule in Excel that has names in Column A
(approximately 500 entries). I'd like to create a macro that could
print an individual page for each individual employee and place their
name in the header. Can you do this in Excel? or is this better
suited for Access?

Just curious if anyone has any experience with something like this.



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 29
Default Macro for Print Program

This almost gets me there, except that it prints a copy of the ENTIRE
schedule for each employee. I rather just want to print out the
schedule for the "current page" of the employee row, thus only
providing the relevant page for each employee.

Anyone got that trick?

-Nimish
Ron de Bruin wrote:
Hi Nimish

With names in A1: A10 try this

If it is working OK then change 10 to 500 and delete preview:=True

Sub PrintCopies_ActiveSheet()
Dim CopieNumber As Long

For CopieNumber = 1 To 10
With ActiveSheet
.PageSetup.LeftHeader = Cells(CopieNumber, "A").Value

'Print the sheet
.PrintOut preview:=True
End With
Next CopieNumber
End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl



"Nimish" wrote in message ups.com...
Hi All:

I have a employee schedule in Excel that has names in Column A
(approximately 500 entries). I'd like to create a macro that could
print an individual page for each individual employee and place their
name in the header. Can you do this in Excel? or is this better
suited for Access?

Just curious if anyone has any experience with something like this.


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,123
Default Macro for Print Program

I am not sure I understand you.

Can you give more details


--
Regards Ron de Bruin
http://www.rondebruin.nl



"Nimish" wrote in message ups.com...
This almost gets me there, except that it prints a copy of the ENTIRE
schedule for each employee. I rather just want to print out the
schedule for the "current page" of the employee row, thus only
providing the relevant page for each employee.

Anyone got that trick?

-Nimish
Ron de Bruin wrote:
Hi Nimish

With names in A1: A10 try this

If it is working OK then change 10 to 500 and delete preview:=True

Sub PrintCopies_ActiveSheet()
Dim CopieNumber As Long

For CopieNumber = 1 To 10
With ActiveSheet
.PageSetup.LeftHeader = Cells(CopieNumber, "A").Value

'Print the sheet
.PrintOut preview:=True
End With
Next CopieNumber
End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl



"Nimish" wrote in message ups.com...
Hi All:

I have a employee schedule in Excel that has names in Column A
(approximately 500 entries). I'd like to create a macro that could
print an individual page for each individual employee and place their
name in the header. Can you do this in Excel? or is this better
suited for Access?

Just curious if anyone has any experience with something like this.




  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 29
Default Macro for Print Program

The macro you gave me work, except that the it does nothing to restrict
the print area to a header and the selected row for each employee. I
want to the printing so each employee would only get a printout for his
schedule.


Ron de Bruin wrote:
I am not sure I understand you.

Can you give more details


--
Regards Ron de Bruin
http://www.rondebruin.nl



"Nimish" wrote in message ups.com...
This almost gets me there, except that it prints a copy of the ENTIRE
schedule for each employee. I rather just want to print out the
schedule for the "current page" of the employee row, thus only
providing the relevant page for each employee.

Anyone got that trick?

-Nimish
Ron de Bruin wrote:
Hi Nimish

With names in A1: A10 try this

If it is working OK then change 10 to 500 and delete preview:=True

Sub PrintCopies_ActiveSheet()
Dim CopieNumber As Long

For CopieNumber = 1 To 10
With ActiveSheet
.PageSetup.LeftHeader = Cells(CopieNumber, "A").Value

'Print the sheet
.PrintOut preview:=True
End With
Next CopieNumber
End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl



"Nimish" wrote in message ups.com...
Hi All:

I have a employee schedule in Excel that has names in Column A
(approximately 500 entries). I'd like to create a macro that could
print an individual page for each individual employee and place their
name in the header. Can you do this in Excel? or is this better
suited for Access?

Just curious if anyone has any experience with something like this.





  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,123
Default Macro for Print Program

Is it only one row for each employee
Or is there also a header row that you want to print

--
Regards Ron de Bruin
http://www.rondebruin.nl



"Nimish" wrote in message ups.com...
The macro you gave me work, except that the it does nothing to restrict
the print area to a header and the selected row for each employee. I
want to the printing so each employee would only get a printout for his
schedule.


Ron de Bruin wrote:
I am not sure I understand you.

Can you give more details


--
Regards Ron de Bruin
http://www.rondebruin.nl



"Nimish" wrote in message ups.com...
This almost gets me there, except that it prints a copy of the ENTIRE
schedule for each employee. I rather just want to print out the
schedule for the "current page" of the employee row, thus only
providing the relevant page for each employee.

Anyone got that trick?

-Nimish
Ron de Bruin wrote:
Hi Nimish

With names in A1: A10 try this

If it is working OK then change 10 to 500 and delete preview:=True

Sub PrintCopies_ActiveSheet()
Dim CopieNumber As Long

For CopieNumber = 1 To 10
With ActiveSheet
.PageSetup.LeftHeader = Cells(CopieNumber, "A").Value

'Print the sheet
.PrintOut preview:=True
End With
Next CopieNumber
End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl



"Nimish" wrote in message ups.com...
Hi All:

I have a employee schedule in Excel that has names in Column A
(approximately 500 entries). I'd like to create a macro that could
print an individual page for each individual employee and place their
name in the header. Can you do this in Excel? or is this better
suited for Access?

Just curious if anyone has any experience with something like this.





  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 29
Default Macro for Print Program

Row 1 will be a header row that I want to print.

Then it is one row for each employee.


So, print rows1 & rows(Copienumber) is how I want it.



Ron de Bruin wrote:
Is it only one row for each employee
Or is there also a header row that you want to print

--
Regards Ron de Bruin
http://www.rondebruin.nl



"Nimish" wrote in message ups.com...
The macro you gave me work, except that the it does nothing to restrict
the print area to a header and the selected row for each employee. I
want to the printing so each employee would only get a printout for his
schedule.


Ron de Bruin wrote:
I am not sure I understand you.

Can you give more details


--
Regards Ron de Bruin
http://www.rondebruin.nl



"Nimish" wrote in message ups.com...
This almost gets me there, except that it prints a copy of the ENTIRE
schedule for each employee. I rather just want to print out the
schedule for the "current page" of the employee row, thus only
providing the relevant page for each employee.

Anyone got that trick?

-Nimish
Ron de Bruin wrote:
Hi Nimish

With names in A1: A10 try this

If it is working OK then change 10 to 500 and delete preview:=True

Sub PrintCopies_ActiveSheet()
Dim CopieNumber As Long

For CopieNumber = 1 To 10
With ActiveSheet
.PageSetup.LeftHeader = Cells(CopieNumber, "A").Value

'Print the sheet
.PrintOut preview:=True
End With
Next CopieNumber
End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl



"Nimish" wrote in message ups.com...
Hi All:

I have a employee schedule in Excel that has names in Column A
(approximately 500 entries). I'd like to create a macro that could
print an individual page for each individual employee and place their
name in the header. Can you do this in Excel? or is this better
suited for Access?

Just curious if anyone has any experience with something like this.




  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,123
Default Macro for Print Program

OK, try this

Row 1 is the header row so the first name is in A2
This example loop through the first 10 names and use AutoFilter
to filter on each name and then print

Sub PrintCopies_ActiveSheet_2()
Dim CopieNumber As Long

Application.ScreenUpdating = False
For CopieNumber = 2 To 11
With ActiveSheet
.PageSetup.LeftHeader = Cells(CopieNumber, "A").Value
.Range("A:A").AutoFilter Field:=1, Criteria1:=Cells(CopieNumber, "A").Value
'Print the sheet
.PrintOut preview:=True
.AutoFilterMode = False
End With
Next CopieNumber
Application.ScreenUpdating = True
End Sub



--
Regards Ron de Bruin
http://www.rondebruin.nl



"Nimish" wrote in message oups.com...
Row 1 will be a header row that I want to print.

Then it is one row for each employee.


So, print rows1 & rows(Copienumber) is how I want it.



Ron de Bruin wrote:
Is it only one row for each employee
Or is there also a header row that you want to print

--
Regards Ron de Bruin
http://www.rondebruin.nl



"Nimish" wrote in message ups.com...
The macro you gave me work, except that the it does nothing to restrict
the print area to a header and the selected row for each employee. I
want to the printing so each employee would only get a printout for his
schedule.


Ron de Bruin wrote:
I am not sure I understand you.

Can you give more details


--
Regards Ron de Bruin
http://www.rondebruin.nl



"Nimish" wrote in message ups.com...
This almost gets me there, except that it prints a copy of the ENTIRE
schedule for each employee. I rather just want to print out the
schedule for the "current page" of the employee row, thus only
providing the relevant page for each employee.

Anyone got that trick?

-Nimish
Ron de Bruin wrote:
Hi Nimish

With names in A1: A10 try this

If it is working OK then change 10 to 500 and delete preview:=True

Sub PrintCopies_ActiveSheet()
Dim CopieNumber As Long

For CopieNumber = 1 To 10
With ActiveSheet
.PageSetup.LeftHeader = Cells(CopieNumber, "A").Value

'Print the sheet
.PrintOut preview:=True
End With
Next CopieNumber
End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl



"Nimish" wrote in message ups.com...
Hi All:

I have a employee schedule in Excel that has names in Column A
(approximately 500 entries). I'd like to create a macro that could
print an individual page for each individual employee and place their
name in the header. Can you do this in Excel? or is this better
suited for Access?

Just curious if anyone has any experience with something like this.






  #9   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 29
Default Macro for Print Program

Ron,

Thank you so much! I knew I could just use the autofilter to print,
but was having some trouble setting the criteria. Thanks so much for
your help.

-Nimish

Ron de Bruin wrote:
OK, try this

Row 1 is the header row so the first name is in A2
This example loop through the first 10 names and use AutoFilter
to filter on each name and then print

Sub PrintCopies_ActiveSheet_2()
Dim CopieNumber As Long

Application.ScreenUpdating = False
For CopieNumber = 2 To 11
With ActiveSheet
.PageSetup.LeftHeader = Cells(CopieNumber, "A").Value
.Range("A:A").AutoFilter Field:=1, Criteria1:=Cells(CopieNumber, "A").Value
'Print the sheet
.PrintOut preview:=True
.AutoFilterMode = False
End With
Next CopieNumber
Application.ScreenUpdating = True
End Sub



--
Regards Ron de Bruin
http://www.rondebruin.nl



"Nimish" wrote in message oups.com...
Row 1 will be a header row that I want to print.

Then it is one row for each employee.


So, print rows1 & rows(Copienumber) is how I want it.



Ron de Bruin wrote:
Is it only one row for each employee
Or is there also a header row that you want to print

--
Regards Ron de Bruin
http://www.rondebruin.nl



"Nimish" wrote in message ups.com...
The macro you gave me work, except that the it does nothing to restrict
the print area to a header and the selected row for each employee. I
want to the printing so each employee would only get a printout for his
schedule.


Ron de Bruin wrote:
I am not sure I understand you.

Can you give more details


--
Regards Ron de Bruin
http://www.rondebruin.nl



"Nimish" wrote in message ups.com...
This almost gets me there, except that it prints a copy of the ENTIRE
schedule for each employee. I rather just want to print out the
schedule for the "current page" of the employee row, thus only
providing the relevant page for each employee.

Anyone got that trick?

-Nimish
Ron de Bruin wrote:
Hi Nimish

With names in A1: A10 try this

If it is working OK then change 10 to 500 and delete preview:=True

Sub PrintCopies_ActiveSheet()
Dim CopieNumber As Long

For CopieNumber = 1 To 10
With ActiveSheet
.PageSetup.LeftHeader = Cells(CopieNumber, "A").Value

'Print the sheet
.PrintOut preview:=True
End With
Next CopieNumber
End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl



"Nimish" wrote in message ups.com...
Hi All:

I have a employee schedule in Excel that has names in Column A
(approximately 500 entries). I'd like to create a macro that could
print an individual page for each individual employee and place their
name in the header. Can you do this in Excel? or is this better
suited for Access?

Just curious if anyone has any experience with something like this.





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
how do i put a formula in a macro to run a program holy41 Excel Worksheet Functions 1 July 8th 06 02:34 AM
How to stop Excel remembering/loading macro from previously opened Workbook Norman Yuan Excel Discussion (Misc queries) 4 June 17th 06 04:13 PM
Compiling macro based on cell values simonsmith Excel Discussion (Misc queries) 1 May 16th 06 08:31 PM
Search, Copy, Paste Macro in Excel [email protected] Excel Worksheet Functions 0 January 3rd 06 06:51 PM
How to program an excel macro to repeat a series of keystrokes? Beancounter Excel Discussion (Misc queries) 8 January 22nd 05 11:51 PM


All times are GMT +1. The time now is 09:12 AM.

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"