LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 31
Default Conditional Formatting from a group

Claus, Understand. Tx Again. Will be modifying the array's with the real
numbers and will be able to easily change if "they" want to add a new number
group. I also discovered that the "corporate" computer formatted all the
numbers as TEXT before I get a copy.

"Claus Busch" wrote in message ...

Hi again,

Am Fri, 11 Oct 2013 13:37:26 -0400 schrieb wabbleknee:

working with it now.


here it is now with arrBlue. You only have to fill all your numbers to
the arrays:

Sub Color()
Dim arrGreen As Variant
Dim arrRed As Variant
Dim arrBlue As Variant
Dim rngC As Range
Dim LRow As Long
Dim i As Integer
Dim n As Integer
Dim intStart As Integer
Dim intLen As Integer

arrGreen = Array(789, 790, 791, 212)
arrRed = Array(123, 222, 541, 346, 718)
arrBlue = Array(999)
LRow = Cells(Rows.Count, 4).End(xlUp).Row
For Each rngC In Range("D1:D" & LRow)
For i = LBound(arrGreen) To UBound(arrGreen)
For n = 1 To Len(rngC)
intStart = InStr(n, rngC, arrGreen(i) & ".")
If intStart 0 Then
intLen = InStr(intStart, rngC, ",") - intStart
rngC.Characters(intStart, intLen).Font.Color = vbGreen
n = n + intStart + intLen
Else
Exit For
End If
Next
Next
For i = LBound(arrRed) To UBound(arrRed)
For n = 1 To Len(rngC)
intStart = InStr(n, rngC, arrRed(i) & ".")
If intStart 0 Then
intLen = InStr(intStart, rngC, ",") - intStart
rngC.Characters(intStart, intLen).Font.Color = vbRed
n = n + intStart + intLen
Else
Exit For
End If
Next
Next
For i = LBound(arrBlue) To UBound(arrBlue)
For n = 1 To Len(rngC)
intStart = InStr(n, rngC, arrBlue(i) & ".")
If intStart 0 Then
intLen = InStr(intStart, rngC, ",") - intStart
rngC.Characters(intStart, intLen).Font.Color = vbBlue
n = n + intStart + intLen
Else
Exit For
End If
Next
Next
Next
End Sub


Regards
Claus B.
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2

 
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 to group rows with repeating entries Smallweed Excel Discussion (Misc queries) 3 July 7th 08 02:18 PM
conditional formatting group of cells dantee Excel Discussion (Misc queries) 2 June 13th 07 08:12 AM
How to apply conditional formatting on group of cells by using dat Jon Excel Discussion (Misc queries) 7 April 9th 07 11:40 AM
Average a group, where grouping is Conditional on other col.??? tommot82 Excel Discussion (Misc queries) 1 June 9th 06 11:41 AM
Formatting a group of cells for text Lee Excel Discussion (Misc queries) 4 February 25th 06 06:37 PM


All times are GMT +1. The time now is 05:19 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"