LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,646
Default Conditional format via VBA

Place your words in a helper column, in my example it is column A in a helper
worksheet named "pattern", set the backgrond color of cells to the required
color for the word in them, and run this macro:

Sub szinez()
Dim colD As Range
noofrows = Columns("D:D").End(xlDown).Row
Set colD = Range("D2:D" & noofrows)
For Each dcell In colD
hit = WorksheetFunction.Match(dcell.Value,
Worksheets("pattern").Columns("A:A"), 0)
colorno = Worksheets("pattern").Range("A" & hit).Interior.ColorIndex
dcell.EntireRow.Interior.ColorIndex = colorno
Next dcell
End Sub

Regards,
Stefi


€˛bijan€¯ ezt Ć*rta:

Hi all,
could someone please help me to write a vb code with SELECT CASE or IF
statment? I have a sheet with about 5000 rows (A2:K5000)and use some words
like XTT,YBB,NZZ,USS,...(about 10 words) in column D .
what I need to do is each row that contain these word have spetial color in
list for example:
.....................D..............
.....................NZZ.......... red
.....................XTT......... blue
Thanks in advance

 
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
New Conditional Format Overriding Previous Conditional Format Rene Excel Discussion (Misc queries) 3 February 27th 08 06:08 PM
copy conditional format to regular format GDC Setting up and Configuration of Excel 3 May 4th 05 09:35 PM
Multiple conditional on conditional format formula Frank Kabel Excel Programming 1 July 27th 04 06:24 PM
Multiple conditional on conditional format formula Bob Phillips[_7_] Excel Programming 0 July 27th 04 05:30 PM
Keep format after paste from other worksheets - conditional format or EnableControl solution doesn't work No Name Excel Programming 0 May 3rd 04 12:22 PM


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