Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default How to change the background colour on event?

Hi all,

First of all all the best for 2008 and keep up the good work.

Example :
A B C ...
name1 10 5 ...
name2 1 10 ...
name2 15 2 ...
name3 1 10 ...

In an active sheet in Excell, I run a VBA sub to detect the doubles in col
A.
What I would like is that the 2nd. field with "name2" would change the
background colour.
For the moment I have added a dummy collumn where I put an eye catcher.
After that I sort the file and change the background collour manually.
The rest of the collums are not important for this event.

Any ideas?

Thanks,
Leo.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default How to change the background colour on event?

Use conditional formatting with a formula of

=COUNTIF($B2:$B$2000,$B2)1

See http://www.contextures.com/xlCondFormat01.html

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Leo Hamal" wrote in message
...
Hi all,

First of all all the best for 2008 and keep up the good work.

Example :
A B C ...
name1 10 5 ...
name2 1 10 ...
name2 15 2 ...
name3 1 10 ...

In an active sheet in Excell, I run a VBA sub to detect the doubles in col
A.
What I would like is that the 2nd. field with "name2" would change the
background colour.
For the moment I have added a dummy collumn where I put an eye catcher.
After that I sort the file and change the background collour manually.
The rest of the collums are not important for this event.

Any ideas?

Thanks,
Leo.




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default How to change the background colour on event?

Another one, since you specify "the 2nd. field", ie colour the 2nd identical
instance and subsequent duplicates. This counts duplicates 'above' the CF
cell rather than below

=COUNTIF($B$2:$B2,$B2)1

Select B2:down before applying, later copy / paste (-special formats) to new
cells as necessary.

Regards,
Peter T


"Leo Hamal" wrote in message
...
Hi all,

First of all all the best for 2008 and keep up the good work.

Example :
A B C ...
name1 10 5 ...
name2 1 10 ...
name2 15 2 ...
name3 1 10 ...

In an active sheet in Excell, I run a VBA sub to detect the doubles in col
A.
What I would like is that the 2nd. field with "name2" would change the
background colour.
For the moment I have added a dummy collumn where I put an eye catcher.
After that I sort the file and change the background collour manually.
The rest of the collums are not important for this event.

Any ideas?

Thanks,
Leo.




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default How to change the background colour on event?

Sometimes I seem to look for problems.

Why trying VBA coding when a simple conditional formatting does the trick?

Thanks for opening my eyes.
Leo.




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
Change background colour hollies Excel Worksheet Functions 3 October 8th 09 11:54 PM
Change background colour of a row if a particular cell has a value wolfey Excel Discussion (Misc queries) 1 August 3rd 09 12:45 PM
change a cell background colour to my own RGB colour requirements Stephen Doughty Excel Discussion (Misc queries) 4 June 16th 06 01:08 PM
change background colour cityfc Excel Discussion (Misc queries) 1 November 11th 05 01:03 PM
lookup value and change background colour JulieD Excel Programming 14 June 15th 04 11:32 PM


All times are GMT +1. The time now is 05:09 PM.

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

About Us

"It's about Microsoft Excel"