Solved

Excel question reagrding color control

Posted on 2016-09-17
3
47 Views
Last Modified: 2016-10-07
How can I color a row green if I see a certain value in a given cell in that row?
0
Comment
Question by:Malibucompany
  • 2
3 Comments
 
LVL 20

Accepted Solution

by:
crystal (strive4peace) - Microsoft MVP, Access earned 250 total points (awarded by participants)
ID: 41803472
you can use conditional formatting

select the range of cells to format

pick Conditional Formatting from the HOME ribbon tab

choose New Rule...

choose Use a formula to determine which cells to format

if the active cell of the selected range is in row 2 and the cell you want to look at is in column A, under Format values where this formula is true, enter:
=$A2=1

Open in new window

WHERE
1 is the value you want to compare to -- naturally you will want to change this. If it is text, use quotes around the value: "my text value"
A has $ in front so it will not be adjusted. The row needs to be adjusted so it is a relative reference.

then click the Format command button in  the lower right and pick what you want to do
(notice the tabs across the top with other options in the dialog box -- Number, Font, Border, Fill)
1
 
LVL 10

Assisted Solution

by:HuaMinChen
HuaMinChen earned 250 total points (awarded by participants)
ID: 41803726
Hi,
The following is one example to change Foreground color of cell:

Sub CreateWorkbook()
    ' CreateWorkbook Macro
    ' This macro is used to create a workbook for the
    ' Georgetown Dry Cleaning Services

    ' Keyboard Shortcut: Ctrl+Shift+W
    
    Rem Just in case there is anything on the
    Rem worksheet, delete everything
    Range("A:K").Delete
    Range("1:20").Delete
    
    Rem Create the sections and headings of the worksheet
    Range("B2") = "Georgetown Dry Cleaning Services"
    Range("B2").Font.Name = "Rockwell Condensed"
    Range("B2").Font.Size = 24
    Range("B2").Font.Bold = True
    Range("B2").Font.Color = vbBlue
    
    Range("B3:J3").Interior.ThemeColor = xlThemeColorLight2
    
    Range("B5") = "Order Identification"
    Range("B5").Font.Name = "Cambria"
    Range("B5").Font.Size = 14
    Range("B5").Font.Bold = True
    Range("B5").Font.ThemeColor = 5
    
    . . . No Change
          
    Range("B13") = "Items to Clean"
    Range("B13").Font.Name = "Cambria"
    Range("B13").Font.Size = 14
    Range("B13").Font.Bold = True
    Range("B13").Font.ThemeColor = 5
    
    Range("B14") = "Item"
    Range("D14") = "Unit Price"
    Range("E14") = "Qty"
    Range("F14") = "Sub-Total"
    
    . . . No Change
    
    Range("H15") = "Order Summary"
    Range("H15").Font.Name = "Cambria"
    Range("H15").Font.Size = 14
    Range("H15").Font.Bold = True
    Range("H15").Font.ThemeColor = 5
    
    . . . No Change

Open in new window

0
 
LVL 20
ID: 41833339
poster didn't come back so it is difficult to know what was tried
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Bar graph 15 42
Using range instead of selection (VBA) 4 39
compare column in an Excel spreadsheet. 1 38
I NEED KEEP THE CONDITIONAL  FORMATTING 24 26
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

713 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question