Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Excel


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:
Print Sheet2 To Specific Printer
What code can I write to print Sheet1 and Sheet2 on specific Printer and Sheet 3 to another printer, then all other sheets to another printer.

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
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: The Data To Be Printed To Another Printer
I have the following code to print a selection of data which is fine but i need to have in the code a different printer. So, for example my default printer needs to stay the same but when this spreadsheet is open i need the data to be printed to another printer.

View Replies!   View Related
Print Each Worksheet To Printer Of Same Name
I have a workbook with 150-some-odd sheets, each with a store number. I would like to loop through each sheet & print that sheet to the printer with the same name in my printers & faxes queue.

(eg. sheet 9604 would print to printer name oki9604)

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 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
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
VBA Print Preview Code Causes Crash If No Printer Installed
activesheet.printpreview , Excel crashes if there are no printers installed on the machine. How can i check for printers before calling the printpreview, or else stop the program from crashing?

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.

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
Use VBA And Select A Specific Print Area
is there a way to use VBA and select a specific print area.
i want only up to column 'z' and to select from row 'a' to the final row with data in it.

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
When Press Print The Specific Column Not Show
I am after a code that will sort out the below printing problem

I want excel to hide column E from the printer, i want to see the information myself but when i press print column E will not show

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
Go to P44
If P44 = "Running" Then
Print that page
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
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
Programmable Print Area: Macro To Set The Print Area According To The Amount Of Data In A Particular Range Of Cells
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 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)
ActiveCell.Offset(0, -11).Range("A1").Select

View Replies!   View Related
Create Barcodes: Print Out A Sheet That Includes A Code 128 Barcode Of A Specific Number
how to create a barcode in an excel spreadsheet? I am trying to print out a sheet that includes a code 128 barcode of a specific number that I type in.

View Replies!   View Related
Running A Macro When A Value Is Reached In A Specific Cell Used To Call Up Macro
I have a Sheet sheet1 and I want to run a macro when the cell D2 in Sheet1 is equal to 10,7,5,and 3. I only want this macro to run when those values are reached the macro then puts the data onto a sheet called wps. The macro is run as a module and is a sub macro.

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
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
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
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 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
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
Set VBA For Default Printer
I need an assistance in setting up a VBA for the default printer in my office. The issue is I want my spreadsheet to be set up to wherever I open the spreadsheet at any computers in the facility. I want the sheet to be printing out directly at the printer in my office only. Is there a way to do this?

View Replies!   View Related
Way To Set The Printer's Properties Using VBA
Is there a way to set the printer's properties using VBA?

Sometimes we set the printer for BEST quality to do photos or brochures. Well if we don't change it back, when we go to print a spreadsheet, it takes forever because it is set on best quality.

I want to be able to set the print properties to normal using VBA.

View Replies!   View Related
Set Printer To Cell Value
I have a quality form that is produced from data on an Excel log file. I was wondering if it is possible to select a different network printer based upon the value of a certain cell.

I understand how to print using the local machines local printer but our quality department is located at one site and these forms need to be printed at our other locations.

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
Macro To Set Print Area
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 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

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
Using Macro To Set Print Area
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(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 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

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
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
Using Macro To Print Sheet
I am using a macro with the code below to print the active sheet.

Sub MyPrintOut()
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
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
Copyright © 2005-08, All rights reserved