Thread
:
Trouble getting the OFFSET fo work
View Single Post
#
2
Posted to microsoft.public.excel.programming
Don Guillett[_4_]
external usenet poster
Posts: 2,337
Trouble getting the OFFSET fo work
try something like this
Sub dofour()
For Each c In [myrng]
If c = 4 Then
c.Interior.ColorIndex = 39
Cells(c.Row, [initials].Column) _
.Interior.ColorIndex = 39
End If
Next
End Sub
--
Don Guillett
SalesAid Software
"JimP" wrote in message
om...
To anyone,
I have a single column RANGE called "INITIALS" that is located 1
column to the left of a table of data who's RangeName is
"All_ASSIGNED_Schedules"
What I'm trying to do is find all cells in the data table containing
the value "4" and highlight the cell with color. (This part of the
code works fine) ...
but then, on the SAME row I wish to also highlight the column
containing the individuals INITIALS. When I step thru the code, I Know
I'm at the correct column because it reveals the correct set of
INITIALS, but I can't change the color of that cell?
Please advise what's wrong with the line containing the Comment: '???
Dim RowNum As Integer: Dim ColNum As Integer
Dim InitialsColumn As Integer: InitialsColumn =
Range("INITIALS").Column
Dim cell As Range: Range("All_ASSIGNED_Schedules").Select
For Each cell In Selection
' QUICK VIEW all 4-12 shifts with Lavender
If InStr(1, cell.Value, "4") Then
cell.Interior.ColorIndex = 39
RowNum = cell.Row: ColNum = cell.Column
ActiveCell.Offset(0, InitialsColumn - ColNum).ColorIndex =
39 '???
End If
Next cell
Any help would be appreciated!
Jim Pellechi
Reply With Quote
Don Guillett[_4_]
View Public Profile
Find all posts by Don Guillett[_4_]