Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Search a Range for a phrase and Format cell if found

Hi
I've got a spread sheet containing spec's for vehicles, I want to search
them to highlight specific items by changing the cell color

Here's an example of the sheet, this is one column with each line in a cell.

(BYRAB) PROGRAMMABLE DRIVER SEAT
(CBLAE) 315 MHZ DOOR LOCK FREQUENCY
(CFKAA) LESS HEADLAMP CLEANING
(CBSAC) SINGLE LOCKING PWR LOCK LATCH
(DAQAA) LESS BLOCK HEATER RECEPTACLE

I need to highlight any that have "LESS" ,there are 77 columns vehicle of
data by 100 rows

would be gratefully for any help

Kev
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default Search a Range for a phrase and Format cell if found

This is one way of doing it:

Sub test()

Dim arr
Dim r As Long
Dim c As Long

arr = Range(Cells(1), Cells(100, 77))

For r = 1 To 100
For c = 1 To 77
If InStr(1, _
arr(r, c), _
" LESS ", _
vbBinaryCompare) 0 Then
Cells(r, c).Interior.ColorIndex = 27
End If
Next
Next

End Sub


RBS

wrote in message
. uk...
Hi
I've got a spread sheet containing spec's for vehicles, I want to search
them to highlight specific items by changing the cell color

Here's an example of the sheet, this is one column with each line in a
cell.

(BYRAB) PROGRAMMABLE DRIVER SEAT
(CBLAE) 315 MHZ DOOR LOCK FREQUENCY
(CFKAA) LESS HEADLAMP CLEANING
(CBSAC) SINGLE LOCKING PWR LOCK LATCH
(DAQAA) LESS BLOCK HEATER RECEPTACLE

I need to highlight any that have "LESS" ,there are 77 columns vehicle of
data by 100 rows

would be gratefully for any help

Kev


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Search a Range for a phrase and Format cell if found

Thanks for the quick reply that worked a treat.

Kev
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Search a Range for a phrase and Format cell if found

Why not use conditional formatting.

Select all the cells and test for a value of LESS, and select a pattern
colour.

--

HTH

RP
(remove nothere from the email address if mailing direct)


wrote in message
. uk...
Hi
I've got a spread sheet containing spec's for vehicles, I want to search
them to highlight specific items by changing the cell color

Here's an example of the sheet, this is one column with each line in a

cell.

(BYRAB) PROGRAMMABLE DRIVER SEAT
(CBLAE) 315 MHZ DOOR LOCK FREQUENCY
(CFKAA) LESS HEADLAMP CLEANING
(CBSAC) SINGLE LOCKING PWR LOCK LATCH
(DAQAA) LESS BLOCK HEATER RECEPTACLE

I need to highlight any that have "LESS" ,there are 77 columns vehicle of
data by 100 rows

would be gratefully for any help

Kev



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
Extract number from cell when specific format is found paul c Excel Worksheet Functions 6 August 2nd 09 03:45 AM
search folder/directory for a phrase inside excel files pwrichcreek Excel Discussion (Misc queries) 5 August 11th 08 09:39 PM
Found Cell Highlighting after Search ULNazarene Excel Discussion (Misc queries) 1 August 21st 07 07:31 PM
Conditional format if cell match found in another range of cells Nolene Excel Worksheet Functions 2 October 5th 06 06:56 AM
when I search for data in Excel, the found cell cannot be seen Howard in GR Excel Discussion (Misc queries) 3 July 21st 06 09:51 PM


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