Add In Another Option To Select Whether To Print The Page As Horizontal Or Landscape

Aug 29, 2003

I'm using the select sheets to print code from: http://j- walk.com/ss/excel/tips/tip48.htm. I need to add in another option to select whether to print the page as horizontal or landscape. I've been able to add the checkbox, but am having a hard time with the loop to process correctly. I also have the landscape changing code as well. Here is my

Option Explicit
Sub SelectSheets()
Dim i As Integer
Dim TopPos As Integer
Dim TopPos1 As Integer
Dim SheetCount As Integer
Dim PrintDlg As DialogSheet
Dim CurrentSheet As Worksheet
Dim cb As CheckBox
Application.ScreenUpdating = False
If ActiveWorkbook.ProtectStructure Then
MsgBox "Workbook is protected.", vbCritical
Exit Sub
End If
Set CurrentSheet = ActiveSheet............

View 2 Replies


ADVERTISEMENT

VBA To Auto Select Last Populated Print Page

Feb 19, 2014

I have a sheet that already has page breaks set at specific intervals to ensure the data is displayed in a certain way on print, I can only have whole pages. The variable is how many pages are printed on each project, which can be anything between 1 and 20 or more. I have a few columns that contain line numbers, and formulae down the entire length of the sheet, so a basic last populated cell search won't work, but the column I'd like to focus on is Col F, which only has blank/empty cells below the last used one in use. Is it possible to have a BeforePrint code find the last populated cell in Col F and simply capture which print page number it is in, and set that as the number of pages to print?

So in summary, I'd like to be able to just hit Print, and the code will automatically set the number of pages to print based on which page contains the last populated cell in Col F.

View 2 Replies View Related

Landscape Page Numbers On Portrait

Jun 28, 2007

I have Landscape pages in Excel and the user wants to print page numbers on the portrait side. or on the shorter side of the page.

View 2 Replies View Related

Print In Landscape

Jan 11, 2009

How do I print cells A1 : J50 in landscape? I've been trying to use print orientation = landscape but it doesn't really work.

View 2 Replies View Related

Print Macro In Landscape

May 29, 2013

i have the follow code below to print data from A2 to to the last row ihn Col Z (Hidden rows to be excluded)

I can't get the macro to print in Landscape. I also need tpo print with gridlines

Sub Print_all()
Application.ScreenUpdating = False
Sheets(1).Select
Dim LastRow As Long
With ActiveSheet.PageSetup
.Orientation = xlLandscape
End With

[Code]...

View 3 Replies View Related

VBA That Will Print Out Screen In Landscape?

Apr 8, 2014

Code:

Private Sub CommandButton2_Click()
Me.PrintOut
End Sub

Is there a VBA that will print out the screen in landscape? The above code seems to only print in portrait.

View 3 Replies View Related

Print Userform In Landscape

Apr 17, 2006

Is there a code to set the printing of a userform to landscape. The following code is good for a worksheet but doesn't work for a userform.

ActiveSheet.PageSetup.Orientation = xlLandscape

The following adaption of the above brings up an error.

Userform1.PageSetup.Orientation = xlLandscape

View 4 Replies View Related

How Many Characters One Line Can Contain On Printed Page - Landscape / Portrait

Aug 13, 2012

Trying to figure out the width of a single line of printed characters for Landscape v. Portrait (obviously the margins would change this).

View 3 Replies View Related

Print To Fit All Rows And Column On One Page And Take Up Entire Page?

Oct 16, 2013

I have a sheet that changes the number of columns based on data from other sheets. This is the only sheet in the workbook that I will print out every day. I have it set right now to fit all columns on one page, however sometimes this will result in the bottom 1/3rd of the sheet not being used. If I use fit all rows on one page, then some of the columns will get cut off. Is there a way to scale in both directions? My guess is there is not, but I thought I would ask because it would work great for me if I could.

View 4 Replies View Related

Macro To Print Page Based On Active Page

Jun 29, 2007

I need a macro that will print a hidden page that is linked to the page I have active.

It needs to be able to find the correct hidden page that corresponds to the active page because there are multilple pairs of the hidden/visible pages. The name of the hidden page is the same as the visible one with "printout" added to the end. When created, the sheet code names are sheetn and sheetm; n and m being consecutive numbers.

View 3 Replies View Related

Print Parts In Portrait Parts In Landscape

Dec 21, 2006

I have a document needed to be printed with some pages in the middle in landscape page type, the rest in portrait. If using Word it would be easier, but in Excel I cant find the section break to chage page setup separately. Is there anyway to do it. Currently I'm printing the document separately in portrait and then landscape with some page break added and page number modified. However it's quite troublesome and easy to make mistake.

View 3 Replies View Related

Option To Print - Use Print Macro

Dec 30, 2008

I have a few macros that run in a sheet. After the macros are finnished I would like to present to the user a msgbox that asks if they would like to print. if "Yes" is selected, the print macro runs. If "No" is pressed then nothing happens.

View 3 Replies View Related

EXCEL 2011 :: Printing A Horizontal And Vertical Page In 1 Workbook?

Mar 18, 2014

Designing a proposal on MAC EXCEL 2011

1 workbook with:

1 page needs to print vertical

1 page needs to print landscape

Is this possible? (without reloading paper and printing a second time)

Right now I can only get it to print landscape OR portrait but not both ...

View 2 Replies View Related

VBA Macro To Insert Horizontal Page Breaks Based On Criteria Of 1 Column

Jan 10, 2010

I want to achieve is a procedure that inserts horizontal page breaks at certain parts of the sheet where there is a cell equal to 2. Here is the code I have so far.

Sub insert_pagebreak()
Dim printbreak_cell As Range
Dim j As Long
Dim i As Long
ActiveSheet.ResetAllPageBreaks
Set printbreak_cell = Range("AD1")
j = 1
For i = 1 To 100
If printbreak_cell.Value = 2 Then
Set ActiveSheet.HPageBreaks(j).Location = printbreak_cell
j = j + 1
End If
Set printbreak_cell = printbreak_cell.Offset(1, 0)
Next i
End Sub

Everything works until the cell value reaches a 2, and then once it goes into the If statement I get a 'Application-defined or object-defined error' at the below line.

Set ActiveSheet.HPageBreaks(j).Location = printbreak_cell.............

View 3 Replies View Related

Insert Conditional Horizontal Page Breaks Around Logical/Visual Blocks

Apr 28, 2006

I run a report that has several blocks of information with blank rows separating them. The blocks change from time to time and across pages so they are not always in the exact same rows.

I'd like a macro that can insert page breaks around a certain number of rows (say 60), but not insert one between two rows that have any content. If the page break would fall between two filled rows I'd want it to go to the nearest blank row instead.

The pages would be about the same size but the blocks of information would not be broken up. That's my idea, anayway. I don't know VB so I can't be sure it's even possible.

Provided this is possible, I'd greatly appreciate the help, as would all the other people in my organization who have to do this on a daily basis.

View 7 Replies View Related

Excel 2010 :: How To Apply Print Titles To Print On Select Pages

Dec 10, 2012

Using Excel 2010: I have 2 rows (A4:J4 & A5:J5) selected as print titles that I would like to be printed at the top of selected pages. Currently, my document is 3 pages long, and I would like to have the print titles only applied to the first 2 pages. More data will be added in the future on pages 1&2 but the last page (whatever page number it ends up being) should not contain the selected print titles.

View 2 Replies View Related

Add An Option To Print All Except Hidden Sheet

Dec 21, 2006

I have been using this to print multiple sheets. The only problem is if you want all sheets in the workbook you have to check every one. How would I add an option to 'print all'? But I still wouldn't want to print the hidden sheets.

Option Explicit

Sub SelectSheets()
Dim i As Integer
Dim TopPos As Integer
Dim SheetCount As Integer
Dim PrintDlg As DialogSheet
Dim CurrentSheet As Worksheet
Dim cb As CheckBox
Application.ScreenUpdating = False

' Check for protected workbook
If ActiveWorkbook.ProtectStructure Then
MsgBox "Workbook is protected.", vbCritical
Exit Sub
End If...............

View 9 Replies View Related

Using VBA To Select An Option In A System Msg Box

Oct 6, 2007

I have a button in a template file (.xlt) that will save the file as the customer name in cell C4. That template file feeds an Access database and when you save the template file you are prompted with the following system message:

If record DOES NOT exist in DB:

If record DOES exist in DB:

My code is as follows: ....

View 9 Replies View Related

Print The One Page

Dec 29, 2009

I have an Excel 2007 file with a number of tabs, about 15. All has worked well until today. All of a sudden I want to print one page and the preview shows I have 300 pages selected!!!!

I cleared all print ranges,even on hidden files. No luck.....

I only selected one page. it tells me my print margins are off but it will not let me get to any changes in page setup......

I tried printing a few of them and I just get the top few rows of each page.

View 4 Replies View Related

Print Only First Page?

Mar 11, 2014

Can you make excel only print the first page automatically without adjusting settings each time in the print box?

View 1 Replies View Related

Set To Print One Page

Apr 18, 2007

How can I set a workbook to only print the first page without printing it? I want to apply it to a folder full of xls workbooks so whenever a user opens one to print, they can just hit print.

I have tried:

ActiveWindow.SelectedSheets.PrintOut From:=1, To:=1, Copies:=1, Collate:=True

but it sends the file to the printer. I do not want to have to use a macro in each file, I just want to use an existing xls workbook to apply the settings to many other xls workbooks.

View 3 Replies View Related

Use Dropdown List To Select Option

Apr 30, 2014

I have a drop down list that is dependant on another drop down list, all this works fine, however if the user changes the first drop down list the second still continues to display the last option chosen by the user, is there a way to make the 2nd drop down list display "Please Use Drop Down List To Select An Option" instead, also is it also possible to do this without code?

View 3 Replies View Related

Select Option Button With Keystroke

Jun 18, 2007

I have a userform with 3 option buttons. Each buttin is set to display another userform.

Private Sub OptionButton1_Click()
Userform1.Show
End Sub
Private Sub OptionButton2_Click()
Userform2.show
End Sub
Private Sub OptionButton3_Click()
Userform3.Show
End Sub
Private Sub UserForm_Click()

End Sub

Right now the form is running perfectly. If I select an option with the mouse the correct form shows right up. The issue I have is that, the excel file will be running on a computer that will have no mouse. It will be using a barcode reader as its primary input source. What i would like to do is have the user swipe a 1,2 or 3 will the barcode reader or keypad.

View 9 Replies View Related

Print Preview The Page

Nov 23, 2008

I set up a passworded spreadsheet and saved it to my documents folder. I then copied it across to a network area I use to link to a company I work with. The file opens ok on the password but the page is completely white and I can see nothing at all! When I print preview the page I can see all my information but this doesn't help when I need to update it.

Not only that, the whole lot of excel spreadsheets I have both on my documents and the network area are doing the same thing! I've no idea how it's happened or what to do to retrieve the page view.

View 2 Replies View Related

Tab Name To Be Header For Print Page

Nov 24, 2008

I would like to have the tab names as part of my header for printed report. Can I automate that process?

View 2 Replies View Related

Print 1 Report Page For Every Row.

Jan 16, 2010

how to print one report page for every row on a sheet. So if I have 300 rows containing personal info like name phone email I would like to print the data out in a separate formated report for each person.

View 3 Replies View Related

Print A Header Row On All But First Page.

Oct 23, 2008

I have a database that starts on row 10 with header information in row 9 explaining the purpose of the data for each column. In rows 1 through 8 I have general information that when I print the database - I would want on the first printed page (as well as the beginning rows of the database) and have the remaining print pages be the remaining portions of the database but have the header row (row 9) at the top of each - like a header row.

I know how to goto FILE > PAGE SETUP > SHEET > ROWS TO REPEAT AT TOP: - but this will put row 9 at the top of ALL pages...which I want, but not on the first page. I'm ok with making a print button with a macro...but no idea where to begin with the vba code to do this.

View 3 Replies View Related

Print Macro To Fit Page

Apr 1, 2012

I have a macro to print out page 9 but what i whant it to do is to print and fit to full page. how do i do that?

Code:
ExecuteExcel4Macro "PRINT(2,9,9,1,,,,,,,,2,,,TRUE,,FALSE)"
With ActiveSheet.PageSetup
.FitToPagesWide = 1
.FitToPagesTall = 1
End With

View 1 Replies View Related

Print Footer On Last Page Only - VBA?

Jul 21, 2013

I am working on workbook having more then 15 sheets and i want to print the cell reference (L3:P14) as footer automatically but only on the last page printed.

View 2 Replies View Related

Print Columns On One Page

Jun 12, 2014

How do I print columns A:I, and calculating rows dynamically, to fit on one page in portrait.

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved