Solved

Excel question reagrding color control

Posted on 2016-09-17
3
51 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 21

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 11

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 21
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

This article describes a serious pitfall that can happen when deleting shapes using VBA.
If you need to forecast numbers -- typically for finance -- the Windows and Mac versions of Excel 2016 have a basket of tools to get the job done.
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.
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…

627 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