LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 6
Default Select Worksheet to print Macro

The code below is designed to print pallet labels. I have a sheet
where data is entered which is formulated to worksheets named L1 to
L20. I could create 20 different forms with macros attached that have
variations from the one shown below depending on which label I would
like to print. It would be great if I could have one macro that would
select the correct sheet to print based on an input for example. Can
anybody help me?

Also if anybody could refine this code so that the macro runs faster,
that would be much appreciated.

Function RepeatPagePrint(StartPage As Integer, EndPage As Integer,
PageTotal As Integer)


Dim Kount As Integer


For Kount = StartPage To EndPage
Sheets("L1").Select
Range("A1:I44").Select
ActiveSheet.PageSetup.PrintArea = "$A$1:$I$44"
With ActiveSheet.PageSetup
.LeftFooter = "&""Arial,Bold""&48 " & " " & Kount
.CenterFooter = "&""Arial,Bold""&36OF"
.RightFooter = "&""Arial,Bold""&48 " & PageTotal & " "
.CenterHorizontally = False
.CenterVertically = True
.PaperSize = xlPaperA4
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = 99
.FitToPagesWide = 1
.FitToPagesTall = 1
End With
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Next


End Function


Sub DoRepeatPrint()
Dim StPage As Integer
Dim EnPage As Integer
Dim PgTotal As Integer


StPage = 1
EnPage = Val(InputBox("How many Pallets"))
'EnPage = Sheets("Data").Range("K2")
'PgTotal = Sheets("Data").Range("K2")
PgTotal = EnPage

Call RepeatPagePrint(StPage, EnPage, PgTotal)
Sheets("Data").Select
Range("b2").Select



End Sub


Regards,
Angel

 
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 Macro both sheets at once with option to select days etc pano Excel Worksheet Functions 0 January 29th 07 04:09 AM
Select Number of Columns and Print Macro Don Excel Discussion (Misc queries) 0 November 10th 06 09:26 PM
Create a print macro that would automatically select print area? wastedwings Excel Worksheet Functions 7 August 22nd 05 10:36 PM
macro to select data paste/print Anthony Excel Worksheet Functions 1 January 30th 05 04:35 PM
macro to select data/paste/print Anthony Excel Worksheet Functions 1 January 29th 05 08:33 AM


All times are GMT +1. The time now is 06:37 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"