Macro To Print Selection
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
ADVERTISEMENT
Mar 18, 2013
I tried recording a macro but I am keep on getting an error. I need a macro which will print the selection of A1:D28 on a worksheet called Invoice. The print needs to be scaled at 165% of its normal size. i need it to be normal margins and if possible any printer.
View 1 Replies
View Related
Nov 3, 2008
There's a macro I'm trying to figure out for a calendar I'm working on. Here's what it has to do.
1.) Selects the cells for the current month (I assume the user would have to click on the current month itself) plus the two upcoming months. i.e. November, plus December and January.
2.) Sets the selected cells as the area to print, then prints those cells.
If there's anything that might be a challenge, the numbers for the days are all text boxes, if that makes a difference. I've been experimenting with different formulas with no luck.
View 9 Replies
View Related
Mar 15, 2009
I need a macro to select the area within the blue invoice sheet box, so everything within the blue invoice sheet box is selected , and then the selection should be printed. I will have hundreds of these invoice slips made, right below each other, i was wondering once this is done, is there an easier way to to have each invoice selected, instead of making a custom button for each sheet ( which selects just that invoice , and prints that selection ).
( Column m through v, starting at row 2 stoping at row 68, is the selection required in this example, everythign within the blue box. ).
View 13 Replies
View Related
Apr 9, 2013
I've attached a sheet. In this sheet I would like to print the selection....C9:17 and BL9:BW17. I would like to print it onto a PDF and I would like to expand it so it is very visible. Actually, it doesn't need to be PDF. If I could just print this selection and make it visible that would work. I had a problem using print selection because the columns are separated. I also tried fit to page but that makes it too small.Mod's note: file attachment removed at OP's request
View 2 Replies
View Related
Oct 24, 2009
i have a buttion on a whole heap of worksheets that is linked to this sub. I want it to print the range on one sheet of paper. though it will print over 4 sheets.
View 2 Replies
View Related
Jan 16, 2012
Is there a way to have the print dialog box come up, make a selection, and put that selection into a variable?
Ex:
Code:
Application.Dialogs(xlDialogPrint).Show
brings up the print dialog. I need to be able to select the printer and have the selected printer put into a variable in my vba code.
I have tried Ex: w=Application.Dialogs(xlDialogPrint).Show, but all I get is w=true
The reason I need it is because I will be printing via vba code, but the printer may vary for different print jobs.
View 6 Replies
View Related
Feb 22, 2008
Is there are macro that will allow me to: Clear Print Area, then Set Print Area based on user selection and finally print the Print Area to fit 1 page? I tried to search for solutions, but couldn't find any that matched my problem.
View 2 Replies
View Related
Mar 28, 2013
I have a macro that copies my selected area on one workseet, for example B2:M120 on Sheet 1, over to A10 on sheet 2, then prints sheet 2 and then clears the data that was just added leaving sheet 2 as a "clean" template for next use.
Is it possible to add code to the print macro that would look at column G of my selected area and print all rows that had say "cat" in column G on one sheet, all rows with "dog" on another set of sheet 2's, and repeats until all rows of my original selection have been printed?
I thought maybe paste the whole selection then filter, hide unwanted rows, print, repeat but I can't figure out how to repeat and alternate what rows are hidden.
I'm open to any way of doing this, we currently do it by repeating the "select area" but as my real life use replaces "cat" and "dog" with a 9 digit number we are having issues with some rows getting skipped while others get doubled up.
View 1 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
Nov 30, 2009
I searched but didn't find exactly what I needed. I have a workbook with 31 sheets. It is a price guide with each category on a separate worksheet. I figured out how to list the sheets on a separate tab. What my client wants is the ability to:
1. select certain categories for printing, the ToC, Cover and backcover pages have to print in every case
2. the ToC has to change depending on the sheets selected.
I'd rather write some code and give him an an easy command button rather then teaching him how to select non-concurrent sheets and printing only active sheets.
What I'm really stuck on is the updating of the ToC with active sheets only (category and starting page which changes depending on pages selected).
View 13 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
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
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
Apr 14, 2014
How to create a macro that selects only the 2nd file in a folder to be opened instead of every file.
So far the code below is opening every file.
Sub ConsolidateAll()
Dim wkbConsol As Workbook
Dim wksConsol As Worksheet
Dim wkbOpen As Workbook
Dim wksOpen As Worksheet
Dim FolderName As String
Dim FileName As String
Dim Cnt As Long
Application.ScreenUpdating = False
[Code] .......
View 2 Replies
View Related
Dec 31, 2008
This is a piece of code from a macro that i am altering. I keep getting an error when i get to the 2nd line.
View 7 Replies
View Related
Jun 18, 2009
I have data in cells C3 through E3, then a blank column, followed by data in cells G3 through I3. When I use excel to record a macro, it produces the following.
Range("C3").Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlToRight)).Select
However, when I run the macro, it only selects cells C3 through E3. How do I get it to continue through the blank column? I tried to make this example as simple as possible.
View 9 Replies
View Related
Feb 10, 2007
Is there any way this code (below) can be modified so that the macro runs without actually selecting the sheet it requires. The reason for this is so i can hide the sheet (Column Output 3) from view so the data isnt displayed. at the moment the sheet is on view and i would rather it werent. this is the code i have
Sub DistributeRows()
Sheet11.Select
Cells.Select
Application.CutCopyMode = False
Selection.ClearContents
Dim wsAll As Worksheet
Dim wsCrit As Worksheet
Dim wsNew As Worksheet
Dim rngCrit As Range
Dim LastRow As Long
Set wsAll = Worksheets("Column Output 2")
LastRow = wsAll.Range("A" & Rows.Count).End(xlUp).Row
Set wsCrit = Worksheets.Add
Set wsNew = Worksheets("Column Output 3")..............
View 5 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 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