Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Printing numbers in Excel. Macro needed.

I would like to use a macro in Excel to print a number in the top
right hand corner onto blank sheets of A4 paper.


In Cell M1 I would like to have a text string e.g. Order Number
In Cell M2 have the start number
In Cell M3 have the number of copies before the number increments (e.g.
print 4 sheets with 100 then increment to 101
and print another 4 sheets etc.)
In Cell M4 have the total number of "batches" to print. e.g. 10 ( to give 10
* the value in M3)
All help appreciated
Thanks Ted


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Printing numbers in Excel. Macro needed.

Hi
try the following (not fully tested):
Sub print_multiple()
Dim copy_count As Integer
Dim header_txt As String
Dim start_number As Long
Dim batches As Integer
Dim i As Integer

copy_count = Range("M3").Value
header_txt = Range("M1").Value & ": "
start_number = Range("M2").Value
batches = Range("M4").Value

For i = 1 To batches
With ActiveSheet
.PageSetup.RightHeader = header_txt & start_number
.PrintOut Copies:=copy_count
End With
start_number = start_number + 1
Next i
End Sub


you may have to set the print area before invoking this macro (to
prevent printing cells M1:M4)




--
Regards
Frank Kabel
Frankfurt, Germany

EddySon wrote:
I would like to use a macro in Excel to print a number in the top
right hand corner onto blank sheets of A4 paper.


In Cell M1 I would like to have a text string e.g. Order Number
In Cell M2 have the start number
In Cell M3 have the number of copies before the number increments
(e.g. print 4 sheets with 100 then increment to 101
and print another 4 sheets etc.)
In Cell M4 have the total number of "batches" to print. e.g. 10 ( to
give 10 * the value in M3)
All help appreciated
Thanks Ted


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Printing numbers in Excel. Macro needed.

Hi Frank ....

It does exactly what I require. I really do appreciate your
help. You are right I added the print range code to get it to work
correctly.
This is certainly one for the macro archive.
Thanks agian.
Ted

"Frank Kabel" wrote in message
...
Hi
try the following (not fully tested):
Sub print_multiple()
Dim copy_count As Integer
Dim header_txt As String
Dim start_number As Long
Dim batches As Integer
Dim i As Integer

copy_count = Range("M3").Value
header_txt = Range("M1").Value & ": "
start_number = Range("M2").Value
batches = Range("M4").Value

For i = 1 To batches
With ActiveSheet
.PageSetup.RightHeader = header_txt & start_number
.PrintOut Copies:=copy_count
End With
start_number = start_number + 1
Next i
End Sub


you may have to set the print area before invoking this macro (to
prevent printing cells M1:M4)




--
Regards
Frank Kabel
Frankfurt, Germany

EddySon wrote:
I would like to use a macro in Excel to print a number in the top
right hand corner onto blank sheets of A4 paper.


In Cell M1 I would like to have a text string e.g. Order Number
In Cell M2 have the start number
In Cell M3 have the number of copies before the number increments
(e.g. print 4 sheets with 100 then increment to 101
and print another 4 sheets etc.)
In Cell M4 have the total number of "batches" to print. e.g. 10 ( to
give 10 * the value in M3)
All help appreciated
Thanks Ted




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
Excel Macro Needed [email protected] Excel Discussion (Misc queries) 2 April 2nd 08 10:36 PM
Macro needed for assigning serial numbers D Hart Excel Worksheet Functions 2 October 15th 07 11:06 PM
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort Gavin Excel Worksheet Functions 0 May 17th 07 01:20 PM
Save as Macro in excel - Help needed!! Cillian Excel Discussion (Misc queries) 1 January 10th 06 06:52 PM
help needed with excel macro shaltar[_6_] Excel Programming 1 November 21st 03 07:34 PM


All times are GMT +1. The time now is 03:51 AM.

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"