jannahbuang
New Member
- Joined
- Jul 3, 2014
- Messages
- 8
I have code like below. This code will highlight the cell if meet condition. But it also highlight empty cell too.
My problem is to 'no-fill' the highlighted empty cell.
Below is the code sample
My problem is to 'no-fill' the highlighted empty cell.
Below is the code sample
Code:
If processrow > 0 Then
yearidx = Year(.Cells(i, "B").value) - Application.Min(target.Rows(1))
monthidx = Month(.Cells(i, "B").value)
If Application.CountA(target.Rows(processrow)) > 1 Then
processrow = processrow + 1
target.Rows(processrow).Insert
End If
targetcol = yearidx * 12 + monthidx + 1
target.Cells(processrow, targetcol).value = .Cells(i, "C").value
target.Cells(processrow, targetcol).Interior.ColorIndex = 3
End If