Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Locate and change font color

I want to locate a # in a large group of no.s & change their font color

Cell(G2):match same number(E14:N79)change font Pattern (red)
--
Interested in MicroSoft excel 2003, I know just enough to be dangerous,
thats why I am here.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default Locate and change font color

Hi

Try the below and feedback

--The below macro works on Active workbook Worksheets("Sheet1")..

--Initially it turns the font color of all data in the range
Range("E14:N79") to the default color

--Then search for the entries which match cell G2 and turns the font color
to red..

Sub Macro()
Dim varFound As Variant, varSearch As Variant
Dim strAddress As String

varSearch = Range("G2")
Worksheets("Sheet1").Range("E14:N79").Font.ColorIn dex = 0
With Worksheets("Sheet1").Range("E14:N79")
Set varFound = .Find(varSearch, LookIn:=xlValues)
If Not varFound Is Nothing Then
strAddress = varFound.Address
Do
varFound.Font.ColorIndex = 3
Set varFound = .FindNext(varFound)
Loop While Not varFound Is Nothing And _
varFound.Address < strAddress
End If
End With

End Sub

--
If this post helps click Yes
---------------
Jacob Skaria


"Mobil Dick" wrote:

I want to locate a # in a large group of no.s & change their font color

Cell(G2):match same number(E14:N79)change font Pattern (red)
--
Interested in MicroSoft excel 2003, I know just enough to be dangerous,
thats why I am here.

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
Checkbox to change background color, font color and remove/ add bo Sara Excel Discussion (Misc queries) 2 May 1st 23 11:43 AM
Cannot change font color or cell color Bezell Excel Discussion (Misc queries) 2 January 30th 09 06:12 PM
Change Font Color for Dupes on Selection Change [email protected] Excel Programming 3 September 7th 08 02:56 AM
how can I conditionally change font color, or background color? MOHA Excel Worksheet Functions 3 August 21st 06 06:57 PM
How to change the default Border, Font Color, and Cell Color Elijah Excel Discussion (Misc queries) 3 November 2nd 05 11:52 PM


All times are GMT +1. The time now is 02:48 PM.

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"