Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
DEE DEE is offline
external usenet poster
 
Posts: 250
Default Conditional Formatting of one cell based on another using vba

Hello, I have a worksheet whos data comes from SQL Server db. Autofilter is
turned on. Within the worksheet are many columns. I would like to make
change the backcolor of the cells in column C based on the content of the
cell in column D on the same row (i.e. c1=5 d1='Pass' change backcolor of c1
to Green). There isn't a range of cells because the db gets updated more rows
are added. How do I code this using vba? I would like to enter this in the
sheet activate event.
--
DC
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Conditional Formatting of one cell based on another using vba

Hi,

select C1 then

format|Conditional format
Formula is
enter the formula
=AND(C1=5,D1="Pass")

Pick your colour
OK

use format painter to paint this into additional cells if required.

Mike

"Dee" wrote:

Hello, I have a worksheet whos data comes from SQL Server db. Autofilter is
turned on. Within the worksheet are many columns. I would like to make
change the backcolor of the cells in column C based on the content of the
cell in column D on the same row (i.e. c1=5 d1='Pass' change backcolor of c1
to Green). There isn't a range of cells because the db gets updated more rows
are added. How do I code this using vba? I would like to enter this in the
sheet activate event.
--
DC

  #3   Report Post  
Posted to microsoft.public.excel.programming
DEE DEE is offline
external usenet poster
 
Posts: 250
Default Conditional Formatting of one cell based on another using vba

Mike, thanks for replying. I need to do this with vba code in a module. When
someone opens the workbook i would like for the cells in column C to be color
coded based on column D. There could be 50 rows of data on worksheet one
month, after db is updated there could be 70 rows of data. I want the code
to take care of the formatting.
--
DC


"Mike H" wrote:

Hi,

select C1 then

format|Conditional format
Formula is
enter the formula
=AND(C1=5,D1="Pass")

Pick your colour
OK

use format painter to paint this into additional cells if required.

Mike

"Dee" wrote:

Hello, I have a worksheet whos data comes from SQL Server db. Autofilter is
turned on. Within the worksheet are many columns. I would like to make
change the backcolor of the cells in column C based on the content of the
cell in column D on the same row (i.e. c1=5 d1='Pass' change backcolor of c1
to Green). There isn't a range of cells because the db gets updated more rows
are added. How do I code this using vba? I would like to enter this in the
sheet activate event.
--
DC

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
conditional formatting based on the value of another cell bwilde Excel Discussion (Misc queries) 10 January 14th 10 09:38 AM
Conditional formatting, based on a different cell? GD Excel Discussion (Misc queries) 1 February 9th 09 08:14 PM
Conditional formatting, based on a different cell? GD Excel Discussion (Misc queries) 3 February 9th 09 02:36 PM
conditional Formatting based on cell formatting Totom Excel Worksheet Functions 3 January 20th 07 02:02 PM
conditional Formatting based on cell formatting Totom Excel Worksheet Functions 0 January 15th 07 04:35 PM


All times are GMT +1. The time now is 12:06 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"