Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I have this code
Private Sub CommandButton1_Click() Dim TotPages As Long Dim x As Long Dim y As Long TotPages = Application.ExecuteExcel4Macro("GET.DOCUMENT(50)") Sheets("Request Form").Select With ActiveSheet.PageSetup ActiveSheet.PrintOut From:=1, To:=1 End With Sheets("Attendance Sheet").Select TotPages = Application.ExecuteExcel4Macro("GET.DOCUMENT(50)") With ActiveSheet.PageSetup x = 1 y = Range("AH42").Value ActiveSheet.PrintOut From:=x, To:=y End With End Sub When I run it ActiveSheet.PrintOut From:=x, To:=y it wants a range from 1- a large number. When I run this part TotPages = Application.ExecuteExcel4Macro("GET.DOCUMENT(50)") With ActiveSheet.PageSetup x = 1 y = Range("AH42").Value ActiveSheet.PrintOut From:=x, To:=y End With on the actual attendance sheet it runs fine. I am not sure what I am doing wrong. Thanks Cheyenne |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
nine digit zip code won't print in mail merge | Excel Discussion (Misc queries) | |||
Print routine needed for code | Excel Worksheet Functions | |||
How To Print Spreadsheet Report using VBA Code | Excel Discussion (Misc queries) | |||
Leading zero in zip code won't print | Excel Discussion (Misc queries) | |||
Code for Print Layout | Excel Discussion (Misc queries) |