Ark68
Well-known Member
- Joined
- Mar 23, 2004
- Messages
- 4,618
- Office Version
- 365
- 2016
- Platform
- Windows
Will someone review my code below and help me determine why it's not working as hoped?
The code highlighted in purple is supposed to change the value and backcolor of the cell found in the find code. This isn't happening. The code is executed, but the cells don't change.
Rich (BB code):
alias = WorksheetFunction.VLookup(ws_th.Range("A16"), ws_lists.Range("BQ2:CF25"), 16, False)
With ws_shifts
LRow = Application.WorksheetFunction.Match(CDbl(qdate), .Range("A:A"), 0)
With .Range("A" & LRow & ":BE" & LRow)
Set rFind = .Find(What:=alias, LookAt:=xlWhole, MatchCase:=False, SearchFormat:=False)
If Not rFind Is Nothing Then
With .Cells(rFind.Column, rFind.row)
.Value = "Not Staffed"
.Interior.ColorIndex = 3 'red
End With
With .Cells(rFind.Column - 3, rFind.row)
.Value = "X"
.Interior.ColorIndex = 3 'red
End With
End If
End With
The code highlighted in purple is supposed to change the value and backcolor of the cell found in the find code. This isn't happening. The code is executed, but the cells don't change.