I have a code that loops through a worksheet and copies data to a powerpoint table. I'm trying to also make it where it will highlight the cell with a color if it is a certain value. I can't seem to get it to work. Any help would be appreciated.
Code:
j = 1
With ppslide.Shapes("table1")
For k = 3 To ThisWorkbook.Worksheets("ws").Range("K1").Value + 2
j = 1
For i = 1 To 7
.Select
.Table.Cell(k, i).Shape.TextFrame.TextRange.Text = Format(ThisWorkbook.Sheets("ws").Range("L6").Offset(k - 3, j - 1).Value, "0.00")
If ppslide.Shapes("table1").Cell(k, j + 1).Shape.TextFrame.TextRange.Text < 0 Then
ppslide.Shapes("table1").Shape.ForeColor.RGB = RGB(248, 228, 211)
End If
j = j + 1
Next i
Next k
End With