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: 1
Default selection to color cell if the word promise is in cell


I'm trying to write a selection macro that runs through the selected
cells and checks each cell individually for the word promise. If the
word promise is in the cell I would like the cell to be colored. Heck,
I would like the whole row to be colored but I can't even get the cell
to be colored. Can anyone let me know why this isn't working?

Code:
--------------------
Option Explicit

Sub SELECTION_DOESNT_CONTAIN_PROMISE()

Dim myCell As Range
Dim myRng As Range

For Each myCell In Selection.Cells
Select Case Trim(myCell.Value)
Case Is = "*promised*"
myRng.Interior.ColorIndex = 35
myRng.Interior.Pattern = xlSolid 'Do nothing, keep it
End Select
Next myCell

End Sub
--------------------


Thanks in advance


--
DKY
------------------------------------------------------------------------
DKY's Profile: http://www.excelforum.com/member.php...o&userid=14515
View this thread: http://www.excelforum.com/showthread...hreadid=553243

 
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
Changing the color of Cell Selection? ks Excel Discussion (Misc queries) 2 December 18th 09 08:24 PM
Cell Range Selection Color WCMOUSER Excel Discussion (Misc queries) 1 October 18th 08 04:51 PM
word match in string text in cell, color format cell jpmahony Excel Discussion (Misc queries) 1 October 31st 07 03:56 PM
Getting color of each cell in selection Brian J. Matuschak Excel Programming 3 April 26th 06 07:59 PM
Getting the color for each cell in a selection Brian J. Matuschak Excel Programming 3 April 26th 06 06:45 PM


All times are GMT +1. The time now is 04:51 PM.

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"