Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

printing second page in excel 1

Status
Not open for further replies.

ozispimp

IS-IT--Management
Dec 15, 2000
73
US
ok, first off, we have excel that comes with office2k.

the issue is this. i made an excel document, 2 pages in length. the first page, you type in *all* the information, like who the product is being shipped to, and things of that nature.

now, once that information is entered, it pops up on the second sheet of excel in the format that i want. i was wondering if there was anyway, so that i can hit "print" and it will automatically bypass the first page, and just print the second page. instead of having to go and manually click "print page 2 to 2"

see what i'm saying?? also, one other thing, the way i have the second page correspond with the first page, is using = signs.. now this is the second part. sometimes addresses have 4 lines, some have 3.. usually, the last line of the address will have a _ instead of just being blank. anyone know how to just make it show empty without it showing zero??

thanks in advance.
 
Hi,

When you said the information on the second _sheet_ of Excel, do you mean second Excel "worksheet"? If you print it in there, the default Excel setting should be the active worksheet only, unless you are using "personal view"/ personal.xls in Excel with print whole workbook as your default print setting.

However, for the page 2 printing within the same worksheet, highlight the cells you want to print, and then choose File, Print Area, Set Print Area.

For the second part, go to Tools, Options. In the View tab, under Windows Option, uncheck the "Zero value" box, and that should get rid of the zero.

Al
 
Hi ozispimp,

1) Re Printing the one page, take the following steps:

a) Create a Range Name for the Range of cells included in your 2nd Page. - name it "Page_2" for example. To "Name" a cell or range, first highlight the range, then use "Control-F3" (hold down the Control key and hit the F-3 key). Then enter the name (Page_2).

b) Add a "Macro Button" to your sheet - to which you will later attach a piece of VBA code (described later) which will print the 2nd page. If you do not currently have the "icon" for creating a macro button - beside your other icons on top of your sheet, do the following:

Right-click on blank space on the existing toolbar. Then at the bottom of the pop-up window, choose "Customize". At the top of the Customize window, make sure you are are on "Toolbars". Then check-off the "Forms" toolbar, and then choose "Close". This should add the "Forms" toolbar to your set of toolbars. Included in this set of icons is one for creating a "Macro Button". Before I forget, MAKE SURE when you later Exit Excel, to choose "Yes" when asked if you want to update your "Personal" workbook, as this will cause the added toolbar to be retained.

Once the "Forms" toolbar has been added, simply click on the one for "macro button" (4th from the left, I believe), and then with the mouse, simply "click and drag" to create a "macro button" on your sheet.

To attach a macro to the macro button, you simply "right-click" on the button, and choose "Assign Macro". Then select the macro.

But, of course, PRIOR to attaching a macro, you must FIRST create it.

c) The following macro ("Print_Page2") will print your 2nd Page:

Sub Print_Page2()
Range("Page_2").Name = "PR"
ActiveSheet.PageSetup.PrintArea = "PR"
ActiveWindow.SelectedSheets.PrintOut Copies:=1
End Sub

Please NOTE: The above macro is simply going to print the 2nd page, WITH the EXISTING "Page-Setup" settings - which you probably already have set. If not, you should preferably set these before hand.

The following macro (Print_Page2_WithSettings) includes a
COMPLETE set of Page-Setup options. This is primarily for your REFERENCE. I would not recommend including all these settings EACH time you print - because it takes Excel a LONG time to process this information - about 16 seconds on my PC. I'm not sure why it takes SO long.

If you DO have more than one page on the SAME sheet,
and the pages have DIFFERENT settings (other than the ranges) such as Margins, Orientation, then, use the following macro as a REFERENCE, and ONLY copy and paste those lines which require changing for each page.

Naturally, if you DO want to print separate pages on the same sheet, you should probably set up TWO (or more) SEPARATE buttons - for EACH of the Pages.

=========================
START OF DETAILED PRINT MACRO
=========================

Sub Print_Page2_WithSettings()
Application.ScreenUpdating = False
ActiveSheet.PageSetup.PrintArea = "PR"

With ActiveSheet.PageSetup
.PrintTitleRows = ""
.PrintTitleColumns = ""
.LeftHeader = ""
.CenterHeader = ""
.RightHeader = ""
.LeftFooter = ""
.CenterFooter = ""
.RightFooter = ""
.LeftMargin = Application.InchesToPoints(0.6)
.RightMargin = Application.InchesToPoints(0.5)
.TopMargin = Application.InchesToPoints(0.5)
.BottomMargin = Application.InchesToPoints(0.5)
.HeaderMargin = Application.InchesToPoints(0)
.FooterMargin = Application.InchesToPoints(0)
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
.PrintQuality = -4
.CenterHorizontally = True
.CenterVertically = False
.Orientation = xlLandscape
.Draft = False
.PaperSize = xlPaperLegal
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 1
End With

ActiveWindow.SelectedSheets.PrintOut Copies:=1
Application.ScreenUpdating = True
' NOTE: Use the following line INSTEAD, IF you want
' to first PREVIEW the page.
' ActiveWindow.SelectedSheets.PrintPreview

End Sub

=======================
END OF DETAILED PRINT MACRO
=======================

I hope this helps. Please advise as to how you make out.

Regards, …Dale Watson dwatson@bsi.gov.mb.ca
 
I just realized, I forgot to copy the REQUIRED "Dim" statement (to declare a variable) - which is required at the TOP of the Print_Page2 code ...therefore the ENTIRE routine should be as follows:

Dim PR As Range

Sub Print_Page2()
Range("Page_2").Name = "PR"
ActiveSheet.PageSetup.PrintArea = "PR"
ActiveWindow.SelectedSheets.PrintOut Copies:=1
End Sub

Regards, ...Dale Watson dwatson@bsi.gov.mb.ca
 
Thanks, Dreamboat !!!

And thanks also for the link ( ) to the victims of the World Trade Center. Viewing the pictures was indeed a very emotional experience. It gives the viewer an opportunity to "feel closer" to those family members who lost love ones, and, albeit from afar, to help "share in their pain and sorrow". Also, the site serves as one meaningful way of paying tribute to these victims who tragically met their fate on September 11, 2001. My heart goes out to these victims and their families.

A final note... I was QUITE impressed with President Bush's speech to Congress, and I thank him and ALL Americans for the "firm stand" on the need to eliminate terrorism.

Regards, ...Dale Watson dwatson@bsi.gov.mb.ca
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top