D
DKY
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
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