Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have the following macro which I recorded (I am not knowledgeable in VBA).
Sub Print1() Sheets("Buyer List").Select Range("A1:G15").Select ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True Range("A1").Select Sheets("Main").Select End Sub From the worksheet named Main, it goes to the Buyer list worksheet, selects the range A1:G15 and prints. Then goes back to Main. The problem is that I get a far larger range printed and for the life of me, I can not figure out why. It actually prints A1:L225 Any guidance will be appreciated. Thank you. Paul |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub Print1()
Sheets("Buyer List").Select Range("A1:G15").Select Activesheet.pagesetup.printarea =PageSetup.PrintArea= "$A$1:$G$15" ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True Range("A1").Select Sheets("Main").Select End Sub -- When you lose your mind, you free your life. "PA" wrote: I have the following macro which I recorded (I am not knowledgeable in VBA). Sub Print1() Sheets("Buyer List").Select Range("A1:G15").Select ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True Range("A1").Select Sheets("Main").Select End Sub From the worksheet named Main, it goes to the Buyer list worksheet, selects the range A1:G15 and prints. Then goes back to Main. The problem is that I get a far larger range printed and for the life of me, I can not figure out why. It actually prints A1:L225 Any guidance will be appreciated. Thank you. Paul |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I neglected to use Print Selection.
"PA" wrote: I have the following macro which I recorded (I am not knowledgeable in VBA). Sub Print1() Sheets("Buyer List").Select Range("A1:G15").Select ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True Range("A1").Select Sheets("Main").Select End Sub From the worksheet named Main, it goes to the Buyer list worksheet, selects the range A1:G15 and prints. Then goes back to Main. The problem is that I get a far larger range printed and for the life of me, I can not figure out why. It actually prints A1:L225 Any guidance will be appreciated. Thank you. Paul |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sheets("Buyer List").Range("A1:G15").Printout
"PA" wrote: I have the following macro which I recorded (I am not knowledgeable in VBA). Sub Print1() Sheets("Buyer List").Select Range("A1:G15").Select ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True Range("A1").Select Sheets("Main").Select End Sub From the worksheet named Main, it goes to the Buyer list worksheet, selects the range A1:G15 and prints. Then goes back to Main. The problem is that I get a far larger range printed and for the life of me, I can not figure out why. It actually prints A1:L225 Any guidance will be appreciated. Thank you. Paul |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Posted before finishing my thoughts. You don't need to select the range (or
the worksheet, for that matter) to print it. Your macro can be replaced with Sheets("Buyer List").Range("A1:G15").PrintOut "PA" wrote: I have the following macro which I recorded (I am not knowledgeable in VBA). Sub Print1() Sheets("Buyer List").Select Range("A1:G15").Select ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True Range("A1").Select Sheets("Main").Select End Sub From the worksheet named Main, it goes to the Buyer list worksheet, selects the range A1:G15 and prints. Then goes back to Main. The problem is that I get a far larger range printed and for the life of me, I can not figure out why. It actually prints A1:L225 Any guidance will be appreciated. Thank you. Paul |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro not working properly when run automatically | Excel Discussion (Misc queries) | |||
Macro is not working properly | Excel Discussion (Misc queries) | |||
But not working properly | Excel Discussion (Misc queries) | |||
Macro not working properly when the file is shared | Excel Worksheet Functions | |||
Macro "1 tall/1 wide" not working properly | Excel Worksheet Functions |