Solved

Excel question reagrding color control

Posted on 2016-09-17
3
43 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 19

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 19
ID: 41833339
poster didn't come back so it is difficult to know what was tried
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

INDEX and MATCH can be used to great effect to replace HLOOKUP and VLOOKUP as it does not have the limitation of needing the data to be sorted so that the reference value is in the first column or row. It also has the ability to perform a bi-directi…
Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

791 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