PC Review


Reply
Thread Tools Rate Thread

How to change the background colour on event?

 
 
Leo Hamal
Guest
Posts: n/a
 
      6th Jan 2008
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.


 
Reply With Quote
 
 
 
 
Bob Phillips
Guest
Posts: n/a
 
      6th Jan 2008
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" <(E-Mail Removed)> wrote in message
news:4780b48f$0$22307$(E-Mail Removed)...
> 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.
>
>



 
Reply With Quote
 
Peter T
Guest
Posts: n/a
 
      6th Jan 2008
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" <(E-Mail Removed)> wrote in message
news:4780b48f$0$22307$(E-Mail Removed)...
> 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.
>
>



 
Reply With Quote
 
Leo Hamal
Guest
Posts: n/a
 
      11th Jan 2008
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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
change a cell background colour to my own RGB colour requirements =?Utf-8?B?U3RlcGhlbiBEb3VnaHR5?= Microsoft Excel Misc 4 16th Jun 2006 01:08 PM
cant change background colour can547@hotmail.com Windows XP General 2 9th Mar 2006 01:05 AM
Background Colour Change Alec Microsoft Frontpage 10 11th Aug 2005 01:56 PM
Pl Help, How to change Background colour Sarah Microsoft Access Forms 1 28th Sep 2004 03:59 AM
Change Event macro - Changing background colour & font based on content Jim Allen Microsoft Excel Misc 1 21st Apr 2004 01:24 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:11 AM.