ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Visual basic Code (https://www.excelbanter.com/excel-programming/320421-visual-basic-code.html)

grobertson

Visual basic Code
 
Hi,

I have a spreadsheet with a list of cases in rows. Coloumn D lieterally has
a letter B or R, basically I would like some code that if coloumn D says R
then that row is displayed in red if coloumn D says B then the row is
displayed in blue.

Is this possible
Many Thanks
Glenn Robertson

Chip Pearson

Visual basic Code
 
You can use Conditional Formatting from the Format menu to do
this. Select the cells in columns D and open the Conditional
Formatting dialog, change "Cell Value Is" to "Formula Is" and
enter the following formula:

=D1="R"

Click the Format button and choose a Red format. Then click the
Add button to create a new format condition, and change "Cell
Value Is" to "Formula Is" and use the following formula:

=D1="B"

Click the Format button and choose a Blue format.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com




"GRobertson" wrote in
message
...
Hi,

I have a spreadsheet with a list of cases in rows. Coloumn D
lieterally has
a letter B or R, basically I would like some code that if
coloumn D says R
then that row is displayed in red if coloumn D says B then the
row is
displayed in blue.

Is this possible
Many Thanks
Glenn Robertson




Bob Phillips[_6_]

Visual basic Code
 
Glenn,

select the rows in question (let's assume it starts in row 1)
goto FormatConditional Formatting
change condition to Formula Is
add a formula of =$D1="R" (the start row)
select the pattern tab, and choose red
OK
Add condition
same procedure with a formula of =$D1="B"
OK out

--

HTH

RP
(remove nothere from the email address if mailing direct)


"GRobertson" wrote in message
...
Hi,

I have a spreadsheet with a list of cases in rows. Coloumn D lieterally

has
a letter B or R, basically I would like some code that if coloumn D says R
then that row is displayed in red if coloumn D says B then the row is
displayed in blue.

Is this possible
Many Thanks
Glenn Robertson




Don Guillett[_4_]

Visual basic Code
 
have a look at
formatconditional formatting
very self explanatory

--
Don Guillett
SalesAid Software

"GRobertson" wrote in message
...
Hi,

I have a spreadsheet with a list of cases in rows. Coloumn D lieterally

has
a letter B or R, basically I would like some code that if coloumn D says R
then that row is displayed in red if coloumn D says B then the row is
displayed in blue.

Is this possible
Many Thanks
Glenn Robertson





All times are GMT +1. The time now is 10:16 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com