MasterOfDisaster
Board Regular
- Joined
- Dec 19, 2007
- Messages
- 70
I have the following code that goes through each cell of a range and if the cell is green it inputs a value into the cell:
The problem is that some cells remain empty even if they shouldn't (I've verified this in several different ways). It's almost as if some cells of the range get skipped. Any ideas?
Thank you in advance!
Code:
With Worksheets("PivotTable2")
.PivotTables(1).PivotFields("ABC").CurrentPage = pvtitem.Name
End With
Worksheets("ABC" & pvtitem).Range("C6:AD30").Select
For Each cl In Selection
If cl.Interior.ColorIndex = 4 Then
cl.Value = Worksheets("PivotTable2").Cells(cl.row + 1, cl.column + 1).Value
cl.HorizontalAlignment = xlCenter
End If
Next cl
The problem is that some cells remain empty even if they shouldn't (I've verified this in several different ways). It's almost as if some cells of the range get skipped. Any ideas?
Thank you in advance!