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............
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.
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?
I have this code, which does what i want it to do but i want 5 userforms printed in a4 and 1 in a3, also i want to print them all in colour, as they contain graphs, and visually its poor when in black and white
I added in black and white = false, but it still prints black and white, i tried size = A3 and that wouldnt work either
I have a number defined print ranges. I wish to create a list of all the named print ranges and then select certain ranges to print in a single document. I have been told can use something called a "userform".
with printing a long userform? Unfortunately, the me.printform does not print out the whole form. It gets cut off because my form is too long and slightly too wide. I also tried to do a print screen, but unfortunately, because my form is too long, it will only do a snapshot of a portion of the form. In my case, on the bottom as that is where I have placed my command button.
Does anyone know how to bring the whole form out to excel or word? I don't mind doing that as long as I can print out the whole form?
On my excel 2007 UserForm I have a CheckBox with 18 possible or multiple selections of reports (word.docm) what I would like to do is, when selected they would be sent to printer.
Here's what code I have so far, something is missing, I'm not sure
Private Sub CommandButton2_Click() For x = 1 To 18 If Controls("checkbox" & x) Then Select Case x Case x = 1 worddoc = ActiveWorkbook.Path & "Inspection ReportsCover Page.docx" Case x = 2 worddoc = ActiveWorkbook.Path & "Inspection ReportsClient Information.docx" Case x = 3.....................
I have developed an extensive program running on excell but with the user only seeing userforms. I would now like to build in a "print screen" button, but have no idea how to do this.
What it needs to do is capture the userform and all its entries (as it is displayed on the screen) and send this to the printer to be printed as a picture. I am assuming that there must be code available so that when ever the user clicks this button, the standard windows (or excell) print screen appears from which he will be able to choose the printer etc.
I have created a userform which user will fill in, but have come up against usual problem of not being able to print a copy. It has scroll bars so can't just use ctrl + alt + print screen method.
Thought i could get around problem, by recreating the form on worksheet by using activeX labels. I use a basic loop that goes through each of the required controls on the userform and exactly recreates it on the worksheet, using Active X Labels.
This all works fine, but when it gets to end of macro, the userforms just disappears and macro stops. No error message!! Also during the process of creating the axtive x labels i can't step through in VBA as it says its uable to break at that point!!
Private Sub NoPRINTBLANK_Click() Dim percent As Integer Dim Olob As OLEObject Set ctrl = TICKSHEET.Controls pgs = TICKSHEET.COMPS.Pages.Count pgs = pgs - 1 For z = 0 To pgs percent = (z + 1) / (pgs + 1) * 100 ' this is for a progress bar on sheet progresser percent ' this runs small sub to alter progress bar TICKSHEET.Repaint Worksheets("SHT" & z + 1).Activate ActiveSheet.OLEObjects.Delete...................
I know you don't usually print userforms & when you do I know the code, however, how can you print one page of a multipage userform when the page has a vertical scrollbar & you want to print the whole page, not just what is showing on screen?
1/ I enter manually a list of serial numbers in a column
2/ the latest cell gives the number Y (count) of data entered
3/ I need a macro to perform the following on a Form when I press a button: a. the form is printed Y times and every times: b. "Page x of Y" where x increments (Y is the value given by the item 2/) c. the serial number cell shows values from the list one by one (item 1/)
So, that means I will have Y copies of the form where the page number starts at 1 and ends at Y, and a Serial number linked to the list (page 1 shows SN from line1, Page 2 SN from line 2, ... Page Y SN from line Y).
I created a macro that prints a label from a userform. The macro used to reside on an XP platform and performed without issues. IT decided they wanted to upgrade the machine to a Windows 7 platform. Now when the userform prints a small window pops up that looks like a print preview of the label, however it is transparent and has a window caption of 'Precut Label' as identified in the userform design. I am including a screenshot of the pop-up. The unusual thing about this is the window cannot be closed, moved or selected in any way shape or form. The only way to get it to close is to view the userform object in the vba editor. The line of code that triggers the print sequence as well as cause the pop-up is: frmLabel.PrintForm. This line of code is housed in the sheet1 object.
I have a before print event that shows a userform - the user can then select which worksheets they want printed and select a command button. I then have a loop set up that loops through the selected workbooks and prints them. The problem is I am not sure how to tell VBA to print without it going back to the Before Print event userform.
In this worksheet I have data in following range : "N1:V2".
N1 to V1 is headings and N2 to V2 is data transfered from listbox on userform.
I am trying to print this range via command button on my userform.
I am wondering anyone can help me with the code for selecting and printing this range when user clicks on the "Print" command button on my userform?
how I can format this print out to look different than the tabular format? I mean if possible I would like to print this in portrait, fit to one page and possibly not look like a table. (If it has to look like a table then I will have to go with landscape as the table wont fit portrait without getting too small and un-readable)
I have created a custom Menu (excel add-in) to make my work easy in excel. My problem is to print only selected sheets from Workbook in one PDF file, for that I've created a Userform with 2 listboxes, add sheet and print buttons. In the first listbox are listed all the sheets and in the second listbox are the sellected sheets to be printed. What I've succeded so far is to print selected sheets, but it creates one PDF file for each sheet, only if I put my code in workbook and not in Menu add-in (.xla file). As PDF Printer I use PDF reDirect Pro v2.
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.
I inherited a spreadsheet that had an userform where the user checked off which 'pages' he wanted to print. The Ok button routine used if statements to run a routine for each 'page.' Here's an example of the original code for one page:
Sub Button2_Click() Sheet7.Activate Run "HorizontalPrintStuff" 'generic landscape pagesetup With ActiveSheet.PageSetup 'specific pageset settings .RightFooter = " Construction Assumptions" .PrintArea = "CONSTRUCTION" 'the named range to print .Zoom = False .FitToPagesTall = 1 .FitToPagesWide = 1 'this changes depending upon the page selected End With ActiveSheet.PrintOut End Sub
The problem was it printed each page as a separate print job; and if you print to adobe, you get serveral files, not one file. That and it took a long time to run.
So I tried a different tack. If the checkboxes has true, then the printarea is set to that named range. If there were more than one named range on a sheet to be printed, I consolidated them. I did this with a bunch of if statements - very cumbersome.
Sheet3.Activate 'Sheet3.ResetAllPageBreaks 'disabled due to errors Run "HorizontalPrintStuff" 'generic landscape pagesetup With ActiveSheet.PageSetup 'specific pageset settings .PrintArea = "DEVBGTALL" 'the named range to print .FitToPagesWide = 4 'this changes depending upon the .FitToPagesTall = 1 End With
I haven't shown all the code cause it goes on for 12 sheets containing 16 different printareas.
My current muck ups are .....
1) it prints every printarea/named range on a given sheet (I took out all the if statements trying to debug everything.) Is there another conditional argument that allows for multiple 'trues'?
2) the pagebreaks in printarea/named ranges that are multiple pages (like a 48 month schedule) won't stay set. I've tried both VPageBreaks(3).Location:= and .VPageBreaks.Add Before:=
3) the Sheet1.select false argument is always adding a random sheet to the end of the print job. Don't know why.
I can do all this in a recorded macro, just not the selection userform. I've thought about copying to another sheet or hiding columns and rows then printing, but that seems just as cumbersome.
To recap, i want to print out, as one print job, multiple printareas from mulitple sheets, based upon checkbox selection on an userform.
All sheets are basically the same except some minor values, names and addresses. There is one page per sheet and all pages are in portrait format. The print preview shows all the pages in order but when I print it, it makes multiple print jobs of 1 to 2 pages each and prints them all out of order. I don't know why it is splitting up the workbook or why it changes the order. I print and reorder these weekly, which is a major pain. It comes out in the same order each time but it is the wrong order.