Print VBA Code In Color?

Jan 13, 2012

Is there a way to Print VBA code in color, like how it appears on the screen?

View 1 Replies


ADVERTISEMENT

Vb Code To Set Print Area And Print Out

Aug 24, 2007

with creating vb code that will select certain rows in a spreadsheet, set the print area to those rows and print them out, and then reset the print area back to default.
The data is all on one sheet, but is split into 5 different areas, each below the next, with the column headers at the top of each.
e.g.

header_____header_____header
data_______data_______data
data_______data_______data
data_______data_______data

header_____header_____header
data_______data_______data
data_______data_______data
data_______data_______data

and so on. At the press of a button it'll set the print area to the first section and print (the section includes the headers as well as the data). Then at the press of another button it'll set the print area to the next section. There could be any amount of rows of data in each section so it needs to cope with that.

View 9 Replies View Related

Should All Pages In A Workbook Print In Color

Mar 20, 2006

I have a color printer that is set to grayscale as a default. When I print my
excel workbook and select it to print in color in the print driver properties
the first page prints in color but the other pages print in black and white
even though the other pages are in color.

View 12 Replies View Related

Do Not Print Cell Fill Color

Oct 21, 2003

Is it possible to have a cell colored with a fill color in the spreadsheet, but not have the fill color print when the sheet is printed?

View 9 Replies View Related

Clear Background Color Before Print

Jun 12, 2007

I have a excel file wherein background color as well as conditional formatting background color is used. However, since printout consumes huge ink for those sheets, i want that before print the code will clear all the background color (done through Fill color & conditional formatting color) and after the print activity, restore those color. the colors are given to faciliate data entry and better presentation.i have recorded the same but background is not restored when I run the code And also sometimes the code doesnot start printing.

View 4 Replies View Related

Change Font Color In Print Footer

Jun 10, 2008

I wrote a macro to do me page footers

Sub EditFooter()
With ActiveSheet
.PageSetup.CenterFooter = "Page &P of &N"
.PageSetup.RightFooter = "Préparé le " & Format( Date, "dddd, dd MMMM yyyy")
End With
End Sub

it works fine, howver I would like to change the font color to a light grey, and I have no clue how to do that.

View 3 Replies View Related

VBA Code For Set Print Area

Feb 6, 2014

Making a macro that selects active cells (so anything with text in) and sets that as the print area.

Using the default builder I have:

Range("A1:AA44").Select
Range(Selection, Selection.End(xlDown)).Select
ActiveWindow.SmallScroll Down:=30
Range(Selection, Selection.End(xlUp)).Select
Range("A1:AA692").Select
ActiveSheet.PageSetup.PrintArea = "$A$1:$AH$692"

[Code]...

Can trim this code with something

Range("any containing data").Select
ActiveSheet.PageSetup.PrintArea = "selection"

View 1 Replies View Related

How To Set Print Area In Code

Jul 6, 2014

I have 2 codes that set up different "print areas". Every time i run one of the codes the print area doesn't get set unless i run the same code again. So if i run code A which will set the print area with no issues and then right afterwards i run code B then code B's print area won't get set unless i run code B a 2nd time. And if i now i run code A, the same issue happens and the print area to Code A won't get set properly unless i run the code again.

Here is part of the code that discusses the print area:

[Code] .....

View 6 Replies View Related

Possible To Have VB Code To Print A File?

Feb 13, 2013

I have this invoice spreasheet and I would like to when I excecute a macro to print, I would also like to use a PDFwritter to automaticly save/print the pdf file to a location and to ad the invoice number to the name like.

INV"current invoice here".

Bellow is the code I currently have. I am pretty sure this was done as I have some invoices saved but now it doesn't work.

Code:
Sub Check_Info()
If Range("AR1") = Empty Then
MsgBox "No Customer selected!", vbInformation, "Customer..."
Range("AR1").Select

[Code] ........

View 1 Replies View Related

Code To Print Sheet

Nov 27, 2007

I have 7 digit values in Col B12: down. I have sheets with names that match any one of these values. Is it possible for a macro to print all sheets in my workbook whose name matches one of the values in Col B cells 12:down??

View 9 Replies View Related

Print Area Code

May 7, 2008

I have some code to select a print area depending on wether or not there is data in a cell. The code I have so far partially works but not quite like I need it to. Here's what I have,

Sub selectprintarea()
Select Case True

Case Range("C5").Value > 0
Range("A1:M47").Select
ActiveSheet.PageSetup.PrintArea = "$A$1:$M$47"

Case Range("Q5").Value > 0
Range("A1:AA47").Select
ActiveSheet.PageSetup.PrintArea = "$A$1:$AA$47"

End Select
End Sub

It will select the print range if there is data in C5 but if there is data in C5 and Q5 it only selects the first print area. I know I need an "If - Else" or something of that nature but I cant figure that out. Also I need it to look at other worksheets not just the active one. I've tried a replacing the ActiveSheet with Worksheets (Sheet1). but that gives me an error.

View 9 Replies View Related

Print Loop Code

May 7, 2008

I have a print code that I want to run on a loop. In column A Sheet UPSLabels, I have record numbers 1 through 94.

I have a vlookup in "C1" of another sheet that looks at the record number in "B1" and pulls in the correct information from UPSLabels based off the matchin record number in column A. I would like my code to print, update the number in "B1" by 1, and keep printing the records until it reaches 94.

I've probably supplied too much information, but the point is, I need the loop to run until "B1" reaches 94.

Sub print_loop()

Dim cnt As Range
Set cnt = Range("L1")

ActiveWindow.SelectedSheets.PrintOut Copies:=cnt, Collate:=True
Range("b1") = Range("b1") + 1

End Sub

View 9 Replies View Related

Print Preview Code

May 17, 2008

I have some code that Im trying to get to look at the sheets in my workbook and then based on if there is data in a cell and/or cells then select that sheet. Heres what I got so far thats not working. I get an error of Next without for.

Code: ...

View 9 Replies View Related

Set Print Area Through Code

Oct 24, 2008

I am having trouble setting print area on rows that can vary from 100 to 6000 rows. This code works good except that the print area cuts off the last row of data every time. "AreaBegin"=row 6 and "AreaEnd" = to last row after a set number of rows have been inserted based on a counter.

Basically how do I get this code to capture the last row for print area?

Sub SetArea()
ActiveSheet.PageSetup.PrintArea = Range("AreaBegin", Range("AreaEnd").End(xlUp)).Address

View 9 Replies View Related

Print Area VB Code

Jan 19, 2009

I wish the print area to be set based on the number entered into cell "D58". My code so far is:

Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim NumPages As Range
Set NumPages = Range("D48")
Worksheets("Sheet6").PageSetup.PrintArea = Worksheets("Sheet6").Range(0, 0).Resize(NumPages * 21, 47)
End Sub

View 9 Replies View Related

Print Button/Msg Box Code

Jun 11, 2009

I have a print button on several sheets in a workbook. I have a code set for it so that when it is clicked, it will bring up a print dialog box. It looks like this...

Sub Button14_Click()
Application.Dialogs(xlDialogPrint).Show
End Sub

However, on one or two of the sheets, I would like a message box to also display when this button is clicked. The button is called Button14_Click()

Private Sub Button14_Click()
MsgBox "Please print new signature cards for customer(s) to sign"
End Sub

View 9 Replies View Related

Print VBA Code In Colour

Aug 23, 2007

I have a really simple question - am tryingto print my VBA code, but want to print it as it appears in the VBA window, in colour (i.e. green comments, blue operations, etc). Is there a way to set it so the code prints in colour?

View 3 Replies View Related

Code To Print Multiple Pages

Nov 8, 2008

I have a macro that cycles through several student ID numbers and prints a progress report for each one. It works great, but I would like to add an option to pick which printer to use at the beginning of the code. In other words, when I run the macro, the printer box opens and I can pick the printer. When I click okay to print, the macro continues.

View 4 Replies View Related

Print Only Visible Sheets To PDF Code?

Feb 27, 2012

I have a workbook with many worksheets. All I want to do is print to PDF those that are visible (I can use just the code name number can't I?) and ignore those that are hidden. It seems simple enough but it will run and do nothing.

Dim sMsg As String, FName As Variant
Dim myArray() As Integer
Dim i As Integer
Dim j As Integer

[Code]....

View 6 Replies View Related

Capture Print Event To Run Some Code

Jul 21, 2014

Is there a way of capturing the print event to run some code?

I.e. The 'Print' button is clicked and then code executed in the sheet.

View 2 Replies View Related

Code Get Slow Down When Trying To Print The Worksheet

Aug 18, 2009

I have a some code that we use in our office that works ok on my pc. When others in the office try to use the macro the year gets changed to 19 instead of 09. The only problem I have is that the code seems to slow down when it is trying to print the worksheet out. Can the code be shortened up/cleaned up. We are looking for gridlines with inside /outside lines, landscape and left/right margins of .25

Sub IC_Delays()
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Workbooks.Add
Windows("Delays List.xls").Activate
Range("F15:N" & Cells(Rows.Count, "F").End(xlUp).Row).Copy
Windows("Book4").Activate
Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats
Range("A1:I" & Cells(Rows.Count, "A").End(xlUp).Row).Select.........

View 9 Replies View Related

VBA Code To Print To Specfic Printer

Apr 22, 2009

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 9 Replies View Related

Close Print Preview - Vba Escape Code

Mar 23, 2009

macro is not exiting from print preview mode. Need the VBA code so it can close the print preview mode (preferably not "private sub" code)

View 2 Replies View Related

Code To Print File Located In C Drive

Apr 14, 2013

I need code to print a file located in my C drive.

View 6 Replies View Related

Code Before Print Add Inputbox To Change Date

Jun 1, 2007

I was wanting to input the date Before Printing. I want to write some code.

Private Sub Workbook Before_Print (cancel as booleen)
Inputbox = "Enter the date you would like in Mondays cell C4"
Application.Worksheet.Range("C4").Value = InputBox.Value
PrintDialogBox.Show
End Sub

I know I am making a very rough attempt at what I am trying to achieve, I just don't know coding that well.

View 9 Replies View Related

VBA Code For Printing Variable Print Ranges

May 5, 2009

I am trying to write VBA code that will print a print range that is presented in cell F3 on a "Reports" worksheet. The content of F3 will change depending on how many reports the user selects to print. For example, he could select one, two, three reports etc - up to twelve. The cell ranges of each report are named (e.g. Report1, Report2 etc) so that if the user selects to print Reports 1 and 2, the contents of cell F3 are "Report1,Report2". If I replace WhatToPrint with "Report1,Report2" the print macro works.

Sub Macro2()
Dim WhatToPrint As String
WhatToPrint = Sheets("Reports").Cells(3, 6).Value
'sets the variable to equal the contents of cell D3 which contains the formula
'summarising the print ranges I want to print
Sheets("Reports").Cells(3, 6).Select
ActiveCell.FormulaR1C1 = WhatToPrint
' pastes the variable in cell F3 - just to check that it looks like I want it to
Sheets("Reports").PageSetup.PrintArea = WhatToPrint
'uses the variable to set print area - this is where it fails!
'if you replace the variable with the contents of cell F3 the macro will work
ActiveWindow.SelectedSheets.PrintPreview
End Sub

View 3 Replies View Related

Update Print Header And Footer With VBA Code

Jun 22, 2005

I am trying to link what is in the header and footer with information contained in certain Cells. (I eventually want to have a user form to help input the information, but one thing at a time.)

How do I go about getting the following information into code so that I can update the enclosed code?

Left Header: Client Name contained in Sheet: "Table of Contents" B:1

View 5 Replies View Related

Print Color Objects But Not Objects That Are Highlighted / Colored For Input And Grids?

Dec 27, 2013

So I'm creating a grid worksheet for engineering calculations and I have a couple questions about the best way to do it. I've been messing with excel for my calcs for about a decade now, and I every once in a while I try and improve them.

First: I will have several input areas that will either be colored text or shaded background (either works for me). I don't want these 'input required' objects to print as color, just black. But I want my logo at the sheet top to print as color. I've only found ways to not print any color. Can I print the logo as color and the 'input required' stuff as black?

Second: When I do calcs by hand, I write them out on 10x10 grid paper. Each 10x10 grid is one inch. In the past I've created this grid out of the cells, which works. I frequently need to change formulas around though, and each time I do this, I end up needing to mess with the grid cells also. Is there a way to create the grid and have it in the background so it doesn't need to be adjusted each time I change formulas? I wan't the grids to print, and also want to see them on the screen, as I sometimes draw simple objects along with the formulas.

View 9 Replies View Related

Printing Code - Print Everything Down The Sheet Until It Sees A Blank In Col A

Apr 27, 2009

I want to have code that will print everything down the sheet until it sees a blank in column A. I have included the code i am trying but it keeps giving me errors.

View 3 Replies View Related

Code To Print Ranges Based On A Cell's Valvue

Nov 7, 2009

On the attached sheet I would like to set the print range and then print based on 1 cell's valve. F9 is the value I would like to use:

If F9=1 I need it to print A1:M43

If F9=2 I need it to print A1:M87

If F9=3 I need it to print A1:M131 and so on.

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved