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
ADVERTISEMENT
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
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
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
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
View Related
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
Dec 18, 2008
I am using the following code written by a former employee to set a print area for 3 different ranges in my workbook. For some reason the pages are coming out in a landscape format. How do I get the macro to print in portrait?
View 2 Replies
View Related
Sep 24, 2013
I've found some code which works to print certain pages with value in cell A1 but I need to print dynamic ranges on some of the sheets as they will have filters on so the rows ranges will be different each time.
So far this is what I have but the dynamic range part is not working:
VB:
Sub Print_All_Worksheets_With_Value_In_A1()
Dim Sh As Worksheet
Dim Arr() As String
Dim N As Integer
[Code] ....
View 3 Replies
View Related
Oct 18, 2006
I have a "submit" button macro which user would click after he has finished his input. This macro would update a reference number on the worksheet named "orange" and then print out this worksheet.
My purpose is "orange" is printed out with a reference number.
Below is the 1st code.....
View 9 Replies
View Related
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
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
Jun 11, 2007
I have found a macro which disables all print features in excel. I have rwo other codes to print. When I put this macro, It also disables the print from the other macro. How can I use this code so that normal print features will be disabled but if someone takes the print from the macros, Print will be allowed. The code which disables the print is given below:
Private Sub Workbook_BeforePrint(Cancel As Boolean)
If PrtOK Then
Cancel = False
Else
MsgBox "Can't print from here!"
Cancel = True
End If
End Sub
View 9 Replies
View Related
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
Feb 25, 2009
Using Excel 2003 I am trying to write a macro to set the print area according to the amount of data in a particular range of cells. I find I can include this instruction
View 2 Replies
View Related
Jan 15, 2012
I would like to know if there is a way to print several different workbooks at once but keeping my printing format which I would like to be Landscape and Fit to one page. Reason is simple as I work in a office where staff is handed in several jobs to do everyday. They finish the jobs and log all the info on the database. I log on to database and put all their daily diaries and because it is all over the place I have to go in each file and set printing preferences which takes an hour in the morning and hour in the evening. I could do with some sort of automation where all diaries are automatically printed in Landscape and Fit on one page.
View 2 Replies
View Related
May 28, 2014
The print area for each of the rows (summary tab) on the attached has been set up, though using button 3 we need to run the same print macro but ignore any rows (summary tab) that happen to be 0.
The attached sheet only gives two rows but there is a potential for up to 40 of them!
Would an IF function within the macro/code work?
View 14 Replies
View Related
Feb 6, 2010
I need a macro using a command button in sheet 2 that opens the "Print" window to print out the text in sheet 1 (after chosing printer manually of course). I also want a radio button in sheet 2 so I can select if I want to print out page 1-3 instead of page 1-2 in sheet 1.
View 2 Replies
View Related
Dec 12, 2006
What I would like to do is when I click on the print botton or select Print from the File menu, I would like to have a dialog box pop up with a YES botton and NO button asking the question "Would you like to print out the Medication Summary Page?". YES indicates to print off an additional worksheet and NO indicates just print the active sheet.
In the active sheet I have dropdown list in B6 to select a drug name to calculate IV medication drip rates. I also have other worksheets Named the same as in the list. For example, if you select D5W in the list, I have a worksheet named D5W. If you select YES in the message box, I would like to have the Active Sheet and the Medication Summary page print, ELSE just print the Active Sheet.
View 9 Replies
View Related
Jul 24, 2007
I'm close - but I want the 'user' to be able to enter the number zero to either of my prompts without causing the macro to fail. Currently, if a user does not want to print any color copies (i.e. enters 0 - or B&W for that matter) the macro fails. Any ideas?
Sub Print_Report()
Dim CCopies, bwcopies As Integer
Copies = Application.InputBox("How many color copies?", Type:=1)
Copies = Application.InputBox("How many B&W copies?", Type:=1)
Sheets("YTD").PrintOut Copies:=CCopies, ActivePrinter:= _
"network_address_goes_here:", Collate:=True
Sheets("YTD Graph").PrintOut Copies:=CCopies, ActivePrinter:= _
"network_address_goes_here", Collate:=True
Sheets("YTD").PrintOut Copies:=bwcopies, ActivePrinter:= _
"network_address_goes_here", Collate:=True
Sheets("YTD Graph").PrintOut Copies:=bwcopies, ActivePrinter:= _
"network_address_goes_here", Collate:=True
End Sub
View 9 Replies
View Related
Sep 7, 2007
I am wanting to add to my macro a print function.
I have a list of names in Col F
And the Cell A1 powers the data on the sheet.
I want the macro to say if C1 is then make C1=A1, if C1="",stop
and I want that to go on for C2, C3, C4, etc.
View 9 Replies
View Related
Aug 20, 2009
I'm trying to write a macro which prints to PDF and I've been looking through all the posts currently on this forum to get something working. I'm using the following code -
Sub PrintPDF()
Filename = "C:Documents and SettingssambMy Documents" & ActiveSheet.Range("Z1").Value
SendKeys Filename & "{ENTER}", False
ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:= _
"Adobe PDF:", Collate:=True
End Sub
The macro prints to PDF, but then it stops at the Save As stage, where I have to manually enter the name of the file and click Save. I obviously want the macro to automatically name the file with the contents of cell Z1. I then want it to then automatically press enter.
View 9 Replies
View Related
Sep 30, 2009
I have a worksheet with blank tables on 2 template tabs named viz: ON BOARD and NOT ON BOARD, each with 3 sheets to print when viewed on print preview.
What I want is just print ONLY those sheets which have data filled in., i.e if I have data on 1 sheet out of 3 sheets, I want only 1 page to be printed, if there is data on 2 sheets then print only 2 and so on, from both the sheet tabs.
On Page Set up window, I have following specs:
On Page Tab: As follows
Orientation: Landscape
Adjust to: 75 % of normal size
Paper size: 8.5 X 14" Legal
On Sheet Tab:
Print Area A1:O51
Under Print titles:
Rows to repeat at top: $1:$6
These settings are standard for both the sheet tabs.
View 9 Replies
View Related
Jan 13, 2010
I am using a macro with the code below to print the active sheet.
Sub MyPrintOut()
ActiveSheet.PrintOut
End Sub
I assigned the macro to a rectangle. My only problem is that when i print the sheet i can see the rectangle, is there a way around this? I know that i can set the print area but each sheet has a different setup, i tried using .Visible = False for the rectangle but it gave me a few errors.
View 2 Replies
View Related
Nov 20, 2008
I seem to be getting myself into a complete muddle as was wondering if someone to help me with a Printing problem.
On the attached sample, i'm trying to write a macro to print the selection but only print where the status is "Active" to the ned of the selection. However, the spreadsheet is changing on a daily basis i.e. new lines being added and lines being taken off.
So, to take potential of user error out i wanted a macro to print the "active" selection.
View 9 Replies
View Related
Nov 24, 2008
I have a workbook with approximately 260 sheets. These sheets contain financial information. They have to be sorted according to the division within the company, with a total page for each financial division.
I have a code on a blank tab that prints the sheets based on a value in cell B3 on each sheet. (i.e. "VB", "WB", which are initials of our district managers.)
View 6 Replies
View Related
Jun 10, 2009
setting up a print range macro:
I have a sheet where:
1) column A (rows 1-54) needs to be printed with every printing
2) other columns (b-e) or (f-i) etc need to be printed out with each printing
Is it possible to setup a macro to do this as long as I know which columns need to be printed every time (will be same number of rows every time)
Basically, there is info in column A that needs to be printed every time, then I want to be able to print out a months worth of data (b-e for january) for each printout. It is essentially a calendar that I need to print up a hard copy of.
I know zero about vba and much of what I have found on the internet has only confused me more.
View 14 Replies
View Related
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
Jul 20, 2007
Is there a macro that can automatically set the print area by determining what the used range is. For example, If P96 is my last used cell, I would want a1: P96 as my print area.
View 9 Replies
View Related
Oct 11, 2007
My macro selects cells containing data - then i want the macro to set the print area to those selected cells - works fine - but the selected cells won't be the same each time i run the macro. Here's how it looks now:
Range("A1:M1").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlDown)).Select
ActiveSheet.PageSetup.PrintArea = "$A$1:$M$76"
The next time i run the macro the selected cells won't be A1:M76 - how do i have the macro set the print area to whatever is selected?
View 9 Replies
View Related
Oct 16, 2008
I need to know how to make a box that says "print" which will print out pages in my excel file... What I am picturing is this:
Tab 1 Y
Tab 2 Y
Tab 3 N
... etc.
Making a table as the one above, and depending on whether I input "Y" or "N", it will print that tab...
i've seen this in some financial models and would like to incorporate it into my model. If you could offer some detailed help, it would be greatly appreciated. Please note that I am a complete beginner and would need to be taken step-by-step.
View 9 Replies
View Related