Solved

Excel question reagrding color control

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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Suggested Solutions

Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
Introduction While answering a recent question (http:/Q_27311462.html), I created an alternative function to the Excel Concatenate() function that you might find useful.  I tested several solutions and share the results in this article as well as t…
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.
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…

809 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