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?
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
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.
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.
I have created a Sales Data spreadsheet which is updated by 10 members of our sales team. We also have a master sheet which gets updated the moment the individual sheets are updated by the sales team.
I want to know how I can differentiate the new entries with the old ones. Is there a code I can insert in the Master File which would change the colour of the new entries, say for example, all the rows with the date field “August” should automatically be changed to yellow. Similarly all “September” entries should automatically be coloured Red.
Is there a way to automatically conditionally format each column in each row, when either open, closed or cancelled is selecting from a drop down in the Status column. For example every cell is blank in colour, but if I select open in the drop down menu for row A2, the entire row will turn Red. Just wondered if there is a way instead of individually formatting every row separately. I would like to be able to copy the formula or whatever down the entire sheet.
I've had a look through the forum and can't see an answer, so apologies if I'm duplicating something!
I have a spreadsheet where column O has five conditions: 1 PO in 2 High Probability 3 Medium Probability 4 Low Probability Blank
I need to colour code the whole row based on the value in the cells; if there were four conditions, I could do this with conditional formatting, but with five (with white as the fifth condition), I need to look at VBA.
However, I'm having difficulty colouring the whole row; how do I do this?
e.g. what I need to do is: If O2 = "1 PO in"; Select A2:T2; Colour green
In addition, I need to ensure that if there is no data in column D, but column O is "1 PO in", it is highlighted in a separate colour. I have a macro for that, but don't know whether in needs to be put into the code before or after the macro needed above...
I have made several Shapes and assigned macros to them, all is good.
What i am curious about: is it possible to highlight or change colour of the shape on press and return to normal if another is shape is pressed? Just anything to make that particular shape stand out that it has been selected then return to normal when another shape has been selected...
[Code] ....
That is the code so far that is attached to 1x shape...
I'm trying to develop code that will perform the function in the title. I want to use an if statement that looks at cells across the worksheet and where it finds certain text it should colour the entire row. I would also like to be able to input the text via a user box. I don't necessarily want the code
I have a peice of code that i know is inefficient and it is in danger of becoming too large. I have a spreadsheet that has circles aligned to each cell. There are around 100 in total. The code changes the colour of the shape based on the cell value in which it sits. However, the code needs changing and also it does not automatically update the colour shape even though the cell value changes. I have to manually select a cell and then the formula bar and then press return for it to update.
I am using excel 2010.
This is the code i am using for each shape.
Code: If Range("n12").Value = text Then ActiveSheet.Shapes("Oval 250").Fill.ForeColor.RGB = RGB(255, 255, 255) End If
I am working on a spreadsheet for work, and have managed to do everything I need to so far but I need to colour specific letter strings, certain colours within a range of cells (each letter string will only appear once on each sheet)
The strings I will be looking for vary depending on data entered so I will need to cell reference them
The strings that need colouring are in cells with other strings that must stay black (They cannot be separated from other strings due to the nature of the grid)
I need some strings red, some green, and some blue.
These changes should also apply to the whole workbook not just one sheet.
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:
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
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??
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.
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.
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.
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
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
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
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.
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
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
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!