Macro To Print To Specific Printer
I am trying to swith between different printers to print out sheets within a single workbook. Recording the macro doesn't work very well and the code I found online doesn't work either (error: object doesn't support property).
How can I set this up to be a dynamic printer setting?
Code I tried:
View Complete Thread with Replies
Sponsored Links:
Related Forum Messages:
Macro Print To Default Printer
i have a macro that loads a userform for previewing and printing selected sheets. The macro works fine for previewing sheets but when i choose the print button the marco trys to save the file as a .mdi, i want this to select the default printer on the pc instead, the excel file will be onpened on many different pcs so the printers will be different on each machine, hence why i want a default printer selected. This is the section of code from the form
View Replies!
View Related
Print Macro To Send To PDF Printer
I want to automate (with the click of a macro button, or hot key sequence) is to: · take a pre-set print area (which is always the same – 1 page wide x 1 page tall) · send to the printer · select the PDF printer from the list (not the default printer for the computer) · Automatically change the save PDF file name to “(Cell A1) – Weekly Update – (Today’s Date).pdf” · Change location to save file on Desktop Feels like a pretty lofty goal for a macro to do all of that – please let me know if that is even possible to set up.
View Replies!
View Related
Print Out Spreadsheet In Dotmatrix Printer
I have developed one file for invoice printing using VBA coding. When i take print out from excel workbook the print out is comming in Windows Font (i want like Dos prompt printing). I want to take printout in Dot matrics printer for invoice printing and the print out has to come like Lotus123 spreadsheet print out (dos mode). is it possible to get print out like Lotus123? If possible can u please tell me how to change the printing property in excel spreadsheet.
View Replies!
View Related
VBA Code To Print To Specfic Printer
I have a macro that prints out several worksheets. My problem is that I want to print these worksheets to a specific color printer. There are many different users and most of them will have a black-and-white printer setup as their default. I want to be able to print using the ip address of the color printer. I have tried setting the active printer using: Application.ActivePrinter = "\WP010110.117.3.36" with little luck... This seems like such a simple thing! I have done a lot of research and can't find a good solution although I have seen the question raised several times! Ozgrid has been a great source of information and solutions in the past. Please help again!
View Replies!
View Related
Print To A User's Default Printer?
Is there a Macro to automatically print the selected print area (print area is also established within the macro itself) to a user's default printer; whatever that printer may be? Note that this printer and/or printer name could change depending on the user. I would like this to actually select and print to the default printer without Excel having to ask you. I don't even want the "OK" box to show up if possible. I just want them to run the macro, execute all it's duties, and print, all in 1 shot.
View Replies!
View Related
Print Labels To Continuous Roll Printer
We have a an existing spreadsheet which uses a query from Excel to Sage Line50 Accounting software to create labels for stock items. The number of times a label is printed is dictated by the number of items that are required for a particular sales order. For example - 1006abc 100 No. 2003abc 20 No. The program would produce 100 labels for item code 1006abc, and would produce 20 labels for item number 2003abc. However we have recently acquired a heavy duty industrial printer which prints to labels on a continuous roll and I am unable to alter the spreadsheet to work with the new printer layout. I have attached the spreadsheet and, I hope, the VBA code. PLease also see this link to my previous post - Print Labels Dependant on Content
View Replies!
View Related
Choosing Specific Printer In Vba
In my program I want some labels to be printed on printer P661 (black/white) and other labels on printer P656 (color). Q: is it possible to do this in vba for my code? The labels are made in Word and printed from within Excel. Sub PrintNACL_LABEL() Dim oWord As Object Dim sPath As String Dim iCnt As Integer sPath = ThisWorkbook.Path & Application.PathSeparator & "NACL_LABEL.doc" iCnt = Val(InputBox("Hoeveel exemplaren?", "NACL_LABEL", 1)) If iCnt >= 1 Then Set oWord = CreateObject(Class:="Word.Application") With oWord.Documents.Open(sPath) .PrintOut Background:=False, Copies:=iCnt .Close False End With oWord.Quit False End If Set oWord = Nothing End Sub The specific printers in the network are: Color ---> "\PlantijnP656 op Ne00:" Black/white ---> "\plantijn2000oldP661 op Ne02:"
View Replies!
View Related
Printer Detection Macro In VBA
i have a workbook system that is used on 25 standalone machines that all have different printers everytime i install on a new system i have to reconfigure all of the printers that i have set up in VBA i am curious to find out as to whether or not there is a macro i can use that will generate a list of all printers on a machine that i can then use to refrence a printer name in my VBA
View Replies!
View Related
Stop Print Macro Firing Before Print Event
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 Replies!
View Related
Print Specific Rows To A Form
I found a code which is very useful for my project, I have somehow copied the coding and tried to use it, however, I seek help to accomplish it. My question is as follows:- I have 3 forms,namely PO1,PO2 & PO3. All the data is extracted from the spreadsheet, how do I call up the PO2 form if the row selected is PO2? Attached is my file for better understanding.
View Replies!
View Related
Print All Worksheets Before Specific Sheet
I am seeking the most efficient code to print all excel worksheets beginning with sheet "XYZ" and ending with the last sheet in the workbook. - Sheet "XYZ" is always the starting point - The number of sheets after "XYZ" is variable - The names of the subsequent sheets are unique and not sequentially named/numbered - The printing will be to one report (i.e. don't print pages individually)
View Replies!
View Related
Disable Print If Specific Cells Are Empty
I am currently trying to keep the print feature disabled in excel untill any of three specific cells are filled out. So that any of the following possibilities would work: A2 H2 P2 [x] [ ] [ ] [ ] [x] [ ] [ ] [ ] [x] [x] [x] [ ] [ ] [x] [x] [x] [x] [x] This is what I've got so far. Private Sub Workbook_BeforePrint(Cancel As Boolean) If IsEmpty(Range("A2,H2,P2")) Then Cancel = True End If End Sub This code works for A2 but I can't get it to work for H2 or P2. i.e. print will be enabled if A2 has content and disabled if all three cells are blank, but if A2 is empty and H2 has content print will remain disabled.
View Replies!
View Related
Print Page Based On Specific Criteria
I have a report which is split into page sized chunks, in column P I have an identifier Planned, Booked or Running. Is it possible to build a macro which says something along these lines If P1 = "RUNNING" Then Print that Page Else Go to P44 If P44 = "Running" Then Print that page Else Go to P87 and so on until the cell selected is blank then stop.
View Replies!
View Related
Disable Print But Allow Print From Macro
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 Replies!
View Related
Option To Print - Use Print Macro
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 Replies!
View Related
Macro To Copy Specific Cells From Row From Source & Stop When Next Row Cell = Specific Value
I have a protected template and unprotected source worksheets - - - what I would like to happen is for the macro to start and if the source worksheet cell B3 equals "Report Total" then stop - otherwise copy template worksheet then copy 6 specific cells from the source to paste values to specific cells on the newly created worksheet (B_ to C7, D_ to I7, E_ to C9, F_ to K9, A_ to C11, M_ to K11 and then K13=F13-30) After that then start all over again unless the next row’s cell (B4, B5, B6, . . .) is "Report Total" then stop - - - the row count could be from one to a couple hundred. Here is what I have so far but I know that with each copy the name will change and as it goes down the source file each row will change and I also need help with that. Sheets("ee template").Copy After:=Sheets(3) ActiveSheet.Unprotect Selection.ClearContents Range("I7").Select Selection.ClearContents Range("C7").Select Sheets("source").Select ActiveCell.Offset(0, -11).Range("A1").Select
View Replies!
View Related
New Print Macro
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 Replies!
View Related
Macro Print
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 Replies!
View Related
Macro For Print Out
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 Replies!
View Related
Selecting A Printer
I have a form that all the salespeople use. The last thing in the process is to print the completed form to a specific printer. I recorded a macro to get the proper name of the printer but I am finding out that it records differently for each computer. Is there a way around this?
View Replies!
View Related
Choosing A Printer
I want the user to be able to choose a printer but not print at that time. 1. Store the active printer as a variable using application.activeprinter 2. Have a dialog box (the printers available) popup and have them choose one, then store that 3. I know how to do the rest, but I will have the word document print out with the selected printer, then use the application.activeprinter reset to the original one
View Replies!
View Related
Macro - Repeat Macro A Specific Number Of Times
I have created a macro that copies the outcome of a specific calculation (that is driven by random numbers) and pastes it (as values) into a seperate table. It then recalculates the sheet, copies the new outcome and pastes it into the same table at a row beneath the previous one. However, I would like to be able to determine how many times this loop is repeated (i.e. how many rows of outcomes will be generated) without having to change the macro each time. Is this possible? Maybe by just linking it to a cell where the number of outcomes/repeats is specified.
View Replies!
View Related
Print Button Macro ..
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 Replies!
View Related
Looping Print Macro
A macro that scans Sheet "CSD" Range "B4:B201" for the word "Yellow" and copys the data in the row based on conditions to Sheet "Yellow Ticket" and prints the Ticket. Heres a Pic of my "CSD" Sheet. ******** ******************** ************************************************************************>Microsoft Excel - Hybels_Loading_Tickets redo for post.xls___Running: 11.0 : OS = Windows XP (F)ile (E)dit (V)iew (I)nsert (O)ptions (T)ools (D)ata (W)indow (H)elp (A)boutA1=ABCDEFGHIJKL1 Starting Load # 2 3800 3 Ticket ColorLoad #DropCart #Customer ALLSTARS4" Wave3-0-6 Wave6" Wave18-0-1 Wave10" HB4 Pink3851C1Hawks27 45 5Yellow3852D3Bomgaar's 28 67 6 Yellow3850E5Larry's 34 677 8 9 10 11 12 13 14 Count Sheet Esman Greenhouse's [HtmlMaker 2.42] To see the formula in the cells just click on the cells hyperlink or click the Name boxPLEASE DO NOT QUOTE THIS TABLE IMAGE ON SAME PAGE! OTHEWISE, ERROR OF JavaScript OCCUR. Here's a pic of my "Yellow Ticket" ******** ******************** ************************************************************************>Microsoft Excel - Hybels_Loading_Tickets redo for post.xls___Running: 11.0 : OS = Windows XP (F)ile (E)dit (V)iew (I)nsert (O)ptions (T)ools (D)ata (W)indow (H)elp (A)boutA1=ABCDEFGH1R. Hls Inc.2Helping Make Your Business Grow!3 4For questions regarding product please call 800..!5For questions regarding shipping or cart removal please call 888-344.3710!6 7 Load # Drop Letter Cart #(1-30).....................
View Replies!
View Related
Fix My Print Macro
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 Replies!
View Related
Print Macro Button
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 Replies!
View Related
Macro To Print Non Duplicates
I've found this macro that prints out the information for each row, when I select the range -which is great. The only problem I have is, if i have the same info in the first row and second row it prints out both. Which is what the Macro below is meant to do. Can a IF formula be placed in the Macro so that if person A in row 1 is already printed, it will skip person A in row 2 and print out the next row, and repeat the process for any other duplicates. Sub PrintForms() Dim StartRow As Integer Dim EndRow As Integer Dim Msg As String Dim i As Integer Sheets("Runsheet").Activate StartRow = Range("StartRow") EndRow = Range("EndRow") If StartRow > EndRow Then Msg = "ERROR" & vbCrLf & "The starting row must be less than the ending row!" MsgBox Msg, vbCritical, APPNAME End If For i = StartRow To EndRow Range("RowIndex") = i If Range("Preview") Then ActiveSheet.PrintPreview Else ActiveSheet.PrintOut End If Next i End Sub
View Replies!
View Related
Auto-Print Macro
I have a spreadsheet where on one tab, there is a list of user inputs for each item number (i.e. Item 1 - Length A, Height B, Width C; Item 2 - Length D, Height E, Width F etc.) so the user is able to modify the number of items and the specs for each item. On another tab in cell BB8, the user is able to type in the item number and an image of that item is displayed. The user can then print out the image. My problem is that usually the number of items is very big list and so it is tedious to manually change the item number each time you want to print out a particular image. I want to write a macro that can automatically change the item number and print out the corresponding image (So for example, if there are 10 items, print out all 10 images with a single macro, as opposed to manually changing the item number and pressing print each time).
View Replies!
View Related
Macro To Print Selection
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 Replies!
View Related
Print Area With A Macro
I am looking to set the print area with a macro, below is what I had hoped would work. It does not. I get unable to get Vlookup property of worksheetFunction class error. Sub Printzed() Start = Range("C6").Address Finish = Res = Application.WorksheetFunction.VLookup(I5, Range("prlu"), 2).Address myPrintArea = Start & ":" & Finish ActiveSheet.PageSetup.PrintArea = myPrintArea End Sub
View Replies!
View Related
Macro To Print Screen
Is there a feature or VB code that will take a screen shot in excel for the sheet that I have active? What I would like to do is run a macro that does a few things, then takes a screen shot and bundles it up in an email to send (Outlook on Exchange). Since the report is 30 MB it cannot be emailed and taking the time to compose a report w/screen shot takes too much time.
View Replies!
View Related
Print Range Macro
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 Replies!
View Related
Print To PDF Macro
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 Replies!
View Related
Using Macro To Print Sheet
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 Replies!
View Related
Macro: Print Sheets If Used
I'm in the process of placing a button on sheet#1 that will print any of the 5 sheets in the workbook that have been used... a sheets use is determined by cell I53 being > 0... I've initially used this code to test I53, but it shows all sheets, regardless of I53 value... Sub PrntUsedShts() Dim ws As Worksheet For Each ws In Worksheets If Range("I53").Value > 0 Then ws.PrintPreview End If Next ws End Sub Ideally, the finished code will send all selected sheets collated as a single print job... Should I be looking at putting test positive sheets into a sheet array?, then printing the sheet array? Once again, your valued input is greatly appreciated...
View Replies!
View Related
Use Macro To Print Spreadsheet
Trying to summarise large (but varied # of rows depending on which project is being reported on) table for specific values. I get the size of the sheet by: FinalRow = Cells(65536, 1).End(xlUp).Row FinalCol = Cells(1, 255).End(xlToLeft).Column As all the search criteria are numbers lists from out ERP System, a 'For' 'Next' loop seems to work on the Auto-filter settings, and only display the matching values. As I am only trying to get the number of occurrences, and not do anything with the data in the sheet, the 'Count' function seems to work pretty well: 'Change to " proper" dates and insert TTC columns Sheets("Data").Select Columns("C:G").NumberFormat = "d/mm/yy;@" Columns("F:F").Insert Shift:=xlToRight Range("F1").FormulaR1C1 = "TTC" Columns("F:F").NumberFormat = "0" Range("F2").FormulaR1C1 = _ "=IF(AND(RC[-1]>0,RC[3]=2),RC[-1]-RC[-2],TODAY()-RC[-2])" Range("F2").Resize(FinalRow - 1, 1).FillDown Range("A1").FormulaR1C1 = "=COUNT(R[1]C:R[500]C)" Range("A1").Select Range(Selection, ActiveCell.SpecialCells(xlLastCell)). AutoFilter How can I replace the '=COUNT(A2:A500)' with '=COUNT(A2:A[FinalRow])' and only count the rows I need to? This sheet can change from between 20 rows up to 50K+. I understand that this may look messy, but have only been playing with VBA for about a month, and I shall tidy it up later.
View Replies!
View Related
Print Preview Macro
1. Uses PrintPreview to view the results centered horiztonally on the page with the worksheet name at the center top of the printout and my name in the lower-right corner of the printout. 2. Closes PrintPreview. Everything is fine, except the macro will NOT close PrintPreview! I don't know what I'm doing wrong. ActiveSheet.PageSetup.PrintArea = "" With ActiveSheet.PageSetup .LeftHeader = "" .CenterHeader = "&F" .RightHeader = "" .LeftFooter = "" .CenterFooter = "" .RightFooter = "Jennifer Large" .LeftMargin = Application.InchesToPoints(0.75) .RightMargin = Application.InchesToPoints(0.75) .TopMargin = Application.InchesToPoints(1) .BottomMargin = Application.InchesToPoints(1) .HeaderMargin = Application.InchesToPoints(0.5).........................
View Replies!
View Related
Print Graph With Macro
I have a long series of graph about 25 on one work sheet, i write a simple macro and attach to a button, that when pressed prints all graphs on the sheet. Now I need a macro that perform the following. a) user is allowed to enter the desired number of graph and it prints only that chart from the sheet. If he enters 4 it prints only 4th graph b) User is allowed to enter the range and it prints all graph in that range. e.g if user enters 3 - 7 it prints only 3 to 7 graphs
View Replies!
View Related
Change Default Printer
I have got a buttion that changes various layout and borders for the page then shows a printpreview, after printprewiew closes. Then a msgbox that askes if you would like print. Is there a way to change the defult printer between local printer and adobe distiller(.pdf) as a dropdown option box. Or Yes for Local printer and NO for adobe distiller(.pdf) using vbYesNoCancle.
View Replies!
View Related
Find Active Printer
I have excel printing some sheets to pdf and it works fine on my PC. WHen someone else tries to print it wont work because they arent on "Adobe PDF on Ne02:"...they maybe on Ne03 or Ne08 or ne05...you get my point. I saw code on here before as to how to find the proper "port" but after a bit of searching, i cant find it again. Application.ActivePrinter = "Adobe PDF on Ne02:" ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:= _ "Adobe PDF on Ne02:"
View Replies!
View Related
|