Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Print Macro both sheets at once with option to select days etc | Excel Worksheet Functions | |||
Select Number of Columns and Print Macro | Excel Discussion (Misc queries) | |||
Create a print macro that would automatically select print area? | Excel Worksheet Functions | |||
macro to select data paste/print | Excel Worksheet Functions | |||
macro to select data/paste/print | Excel Worksheet Functions |