Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi!
I need to find out what's the syntax in VBA to find a cell that contain a certain word and select the cell? Then I need to colour the selected cell that contains the certain word. Thanks! --- Message posted from http://www.ExcelForum.com/ |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
From VBA Help:
Find Method Example This example finds all cells in the range A1:A500 on worksheet one that contain the value 2, and then it makes those cells gray. With Worksheets(1).Range("a1:a500") Set c = .Find(2, lookin:=xlValues) If Not c Is Nothing Then firstAddress = c.Address Do c.Interior.Pattern = xlPatternGray50 Set c = .FindNext(c) Loop While Not c Is Nothing And c.Address < firstAddress End If End With Regards, Shah Shailesh http://members.lycos.co.uk/shahweb/ *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks for the example. Will it work for text as well cuz in your
example u used a number... --- Message posted from http://www.ExcelForum.com/ |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Yes it will.
-- Regards, Tom Ogilvy "desmondleow" wrote in message ... Thanks for the example. Will it work for text as well cuz in your example u used a number... --- Message posted from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
select row if find word | Excel Discussion (Misc queries) | |||
select date range then find average of values in another cell | Excel Worksheet Functions | |||
Use find to select entire rows with a cell with that value | Excel Worksheet Functions | |||
How do I select the last alphanumric word in an excel column with. | Excel Worksheet Functions | |||
In Excel, how do I find one word in a set of text in a cell? | Excel Discussion (Misc queries) |