Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Find Character & Highlight Cell

I'm trying to hightlight cells that have the asterisk (*) symbol in
them. I have tried a couple things, but it is not coming to fruition.
Can somebody please look at my code below and let me know what I am
missing or suggest a better method at getting to the end result?

------------------------------------------
Dim c As Range
Dim rng As Range

For Each c In Sheets("Sheet1").Range(Cells(1, "A"),
Cells(Rows.Count, "K").End(xlUp))
If c = Sheets("Sheet1").Range("F2") Then
Set rng = Sheets("Sheet1").Range(Cells(c.Row, "A"),
Cells(c.Row, "K"))
With rng.Interior
.ColorIndex = 16
.Pattern = xlSolid
End With
End If
Next c
-------------------------------------------

Thank you,

J

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Find Character & Highlight Cell

If c.Text = Sheets("Sheet1").Range("F2").Text

If you are using the Find command either manually or in code, use ~*
instead of just *

--
Regards,
Tom Ogilvy

"J-Money" wrote in message
ups.com...
I'm trying to hightlight cells that have the asterisk (*) symbol in
them. I have tried a couple things, but it is not coming to fruition.
Can somebody please look at my code below and let me know what I am
missing or suggest a better method at getting to the end result?

------------------------------------------
Dim c As Range
Dim rng As Range

For Each c In Sheets("Sheet1").Range(Cells(1, "A"),
Cells(Rows.Count, "K").End(xlUp))
If c = Sheets("Sheet1").Range("F2") Then
Set rng = Sheets("Sheet1").Range(Cells(c.Row, "A"),
Cells(c.Row, "K"))
With rng.Interior
.ColorIndex = 16
.Pattern = xlSolid
End With
End If
Next c
-------------------------------------------

Thank you,

J



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
find the last occurance of a character in a cell Tonso Excel Discussion (Misc queries) 5 April 3rd 10 09:54 PM
Find first character in cell mahmad Excel Worksheet Functions 10 October 2nd 08 05:03 PM
find replace the 1st character in a cell Pete Excel Discussion (Misc queries) 2 March 31st 08 07:27 AM
find a cell with a character Dan Kowalski Excel Worksheet Functions 1 February 28th 08 05:00 PM
click on one cell to find and highlight a related cell? JustSomeGuy Excel Discussion (Misc queries) 1 September 3rd 07 03:02 PM


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