Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default Rows ColorIndex

Hi Group,

Needs some help on following;
Have a column with variable values as:
1
1
1
2
2
3
4
4
4
5
5
etc
The number of rows with 1:s etc are changing. Try to give the rows with the
same value the same InteriorColor in 2 shades.
First all 1:s to be ColorIndex =15 then the 2:s Colorindex = 0 then again
the 3:s ColorIndex = 15 etc.
What is the best approch to this ?

Happy New Year

CG Rosén


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Rows ColorIndex

Sub Tester1()
Dim icolor As Long
Dim i As Long
Dim rng As Range
icolor = 0
Set rng = Cells(1, 1)
i = 1
Do While Not IsEmpty(Cells(i, 1))
If Cells(i + 1, 1) < Cells(i, 1) Then
If icolor = 0 Then icolor = 15 Else icolor = 0
Range(rng, Cells(i, 1)).Interior.ColorIndex = icolor
Set rng = Cells(i + 1, 1)
End If
i = i + 1
Loop

End Sub

--
Regards,
Tom Ogilvy



"CG Rosén" wrote in message
...
Hi Group,

Needs some help on following;
Have a column with variable values as:
1
1
1
2
2
3
4
4
4
5
5
etc
The number of rows with 1:s etc are changing. Try to give the rows with

the
same value the same InteriorColor in 2 shades.
First all 1:s to be ColorIndex =15 then the 2:s Colorindex = 0 then again
the 3:s ColorIndex = 15 etc.
What is the best approch to this ?

Happy New Year

CG Rosén




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
Exel 97 ColorIndex Shawn Excel Discussion (Misc queries) 1 October 2nd 09 06:03 PM
ColorIndex skat Excel Worksheet Functions 5 June 5th 06 02:42 AM
VBA ColorIndex Formatting [email protected] Excel Discussion (Misc queries) 5 February 20th 06 03:38 PM
colorindex Nell Fahey Excel Discussion (Misc queries) 3 April 28th 05 07:06 PM
Font and Fill ColorIndex Frank[_19_] Excel Programming 3 October 31st 03 01:52 PM


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

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"