Consulting

Results 1 to 4 of 4

Thread: PowerPoint change table cell fill and font color

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    VBAX Regular
    Joined
    Dec 2018
    Posts
    24
    Location

    PowerPoint change table cell fill and font color

    Hello, I am having a problem with my code below.

    In a Table in PowerPoint, the user clicks or selects table cells and this VBA shades the background of the cell(s) gray.

    I need it to have blue text RGB(0,100,200) and a white border of 3 pt around the cell(s).

    It works perfect apart from blue text and white borders. Grateful for your help. Thank you.


    Public Sub GrayCell()


    Dim X As Integer
    Dim Y As Integer
    Dim oTbl As Table


    Set oTbl = ActiveWindow.Selection.ShapeRange(1).Table


    For X = 1 To oTbl.Columns.Count
    For Y = 1 To oTbl.Rows.Count


    With oTbl.Cell(Y, X)


    If .Selected <> False Then 'Strange bug - will ignore if statement entirely if you use "= True"
    'Debug.Print "Test worked " & Now


    .Shape.Fill.ForeColor.RGB = RGB(211,211,211)
    End If
    End With
    Next 'y
    Next 'x
    End Sub
    Last edited by StarPig; 01-05-2019 at 03:03 PM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •