Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I have the following code set up to print varying numbers of exce workbooks, based on info from a master list, and it works fine, excep for one thing. Whenever it comes across an item which requires 0 (zero prints, it returns an error saying the number must be between 1 an 63212 (or something). Any ideas on how I can get the macro to skip items which don't requir printing? Sub Printitem() Dim a As String Dim b As Integer Dim c As Integer 'go down the list getting the name of the workbook and 'the amount needed For b = 2 To Worksheets("Sheet1").Cells(65536, 1).End(xlUp).Row 'a gets the name of the workbook a = Worksheets("Sheet1").Cells(b, 1).Value 'c gets the number of prints needed c = Worksheets("Sheet1").Cells(b, 8).Value 'print needed amount of workbook Workbooks.Open ThisWorkbook.Path & Application.PathSeparator & a ".xls" ActiveSheet.PrintOut Copies:=c ActiveWorkbook.Close False 'loop till end Next b End Su -- madblok ----------------------------------------------------------------------- madbloke's Profile: http://www.excelforum.com/member.php...fo&userid=1442 View this thread: http://www.excelforum.com/showthread.php?threadid=39378 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to solve Error 2023 for Excel? | Excel Worksheet Functions | |||
How do I solve the error this #VALUE! error | Excel Worksheet Functions | |||
how do i solve 'file not found' error when linking notebooks? | Excel Worksheet Functions | |||
How do solve window explorer error | Excel Programming | |||
How do I solve Error 2902 | Excel Programming |