Shading rows in a PPT table using VBA

I am trying to find the syntax to shade certain rows in powerpoint table

There are currently multiple tables in a template that are automatically updated using vba, and sometimes the lists have different number of rows. the code that i use to currently populate the tables is below.

Case 1 - The cell that was just populated needs to have the background color changed to grey.

Any suggestions or ideas on how to do it are greatly appreciated...
Private Sub TableUpdate(strShapeName As String, iRowCount As Integer, iColCount As Integer, iColCopy As Integer, iRowCopy As Integer, bFormat As Boolean)
Dim rngFormat As Range
rngFormat = False

If bFormat = True Then
rngFormat = Range("nrTableFormattingStart")

i = 1   'Row Counter for Paste Section
j = 1   'column Counter for Paste Section
k = iRowCopy
l = iColCopy

    ThisWorkbook.Sheets(SHEETMAIN).Activate
    'Set oPPTShape = strShapeName
    
    Do Until i > iRowCount
        Do Until j > iColCount
                oPPTShape.Table.cell(i, j).Shape.TextFrame.TextRange.Text = Cells(k, l).Text
            Select Case rngFormat
            Case 0
            Case 1
                'shade the background of the cell grey
            Case 2
                'Merge the first 4 cells of the table
                
            Case Else
            End Select
            
            j = j + 1
            l = l + 1
            Set rngFormat = rngFormat.Offset(1, 0)
            
        Loop
        
        i = i + 1
        k = k + 1
        j = 1
        l = iColCopy
        
    Loop
 
End Sub

Open in new window

DekkaGAsked:
Who is Participating?
 
JSRWilsonCommented:
Maybe


opptshape.Table.Cell(i, j).Shape.Fill.ForeColor.RGB = RGB(175, 175, 175)

Open in new window

0
 
DekkaGAuthor Commented:
You are two for two. This also worked just right.

Thanks...
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.