PC Review


Reply
Thread Tools Rate Thread

alternating cell colour

 
 
mohd21uk via OfficeKB.com
Guest
Posts: n/a
 
      12th May 2006
I have a spreadsheet where column A has a set of different values. I would
like to alternate the cell colour for changing values.
For e.g

210 - Cell Colour Green
210 - Cell Colour Green
210 - Cell Colour Green
215 - Cell Colour Blue
215 - Cell Colour Blue
220 - Cell Colour Green
221 - Cell Colour Blue
e.t.c

I would be grateful if you could provide me a macro that would do just this.

--
Message posted via http://www.officekb.com
 
Reply With Quote
 
 
 
 
Bob Phillips
Guest
Posts: n/a
 
      12th May 2006
Sub Test()
Dim iLastRow As Long
Dim i As Long
Dim ci As Long

ci = 10
iLastRow = Cells(Rows.Count, "A").End(xlUp).Row
Range("A1").Interior.ColorIndex = ci
For i = 2 To iLastRow
If Cells(i, "A").Value <> Cells(i - 1, "A").Value Then
ci = IIf(ci = 10, 5, 10)
End If
Cells(i, "A").Interior.ColorIndex = ci
Next i

End Sub

--
HTH

Bob Phillips

(remove xxx from email address if mailing direct)

"mohd21uk via OfficeKB.com" <u20517@uwe> wrote in message
news:60227df919109@uwe...
> I have a spreadsheet where column A has a set of different values. I would
> like to alternate the cell colour for changing values.
> For e.g
>
> 210 - Cell Colour Green
> 210 - Cell Colour Green
> 210 - Cell Colour Green
> 215 - Cell Colour Blue
> 215 - Cell Colour Blue
> 220 - Cell Colour Green
> 221 - Cell Colour Blue
> e.t.c
>
> I would be grateful if you could provide me a macro that would do just

this.
>
> --
> Message posted via http://www.officekb.com



 
Reply With Quote
 
Jim Cone
Guest
Posts: n/a
 
      12th May 2006
The free Excel add-in 'Shade Data Rows' could do what you want.
Download from... http://www.realezsites.com/bus/primitivesoftware
--
Jim Cone
San Francisco, USA


"mohd21uk via OfficeKB.com" <u20517@uwe> wrote in message news:60227df919109@uwe...
I have a spreadsheet where column A has a set of different values. I would
like to alternate the cell colour for changing values.
For e.g
210 - Cell Colour Green
210 - Cell Colour Green
210 - Cell Colour Green
215 - Cell Colour Blue
215 - Cell Colour Blue
220 - Cell Colour Green
221 - Cell Colour Blue
e.t.c
I would be grateful if you could provide me a macro that would do just this.
--
Message posted via http://www.officekb.com
 
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
Colour alternating tabs? StargateFanNotAtHome Microsoft Excel Programming 5 20th Aug 2009 04:57 AM
colour rows alternating colour =?Utf-8?B?R3Jk?= Microsoft Excel Misc 6 13th Nov 2007 10:48 PM
Alternating row colour according to month =?Utf-8?B?U2FyYWggKE9HSSk=?= Microsoft Excel Misc 2 17th May 2007 01:11 PM
Alternating background row colour Davie Microsoft Excel Discussion 4 29th May 2006 03:32 PM
Continuous Form / Alternating Row/Record Colour? =?Utf-8?B?QnJvb2s=?= Microsoft Access Forms 2 6th Dec 2005 04:33 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:09 AM.