Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 04-28-2019, 10:49 AM
derridascat derridascat is offline VBA - Changing color of text in a single column of a table Windows 10 VBA - Changing color of text in a single column of a table Office 2016
Novice
VBA - Changing color of text in a single column of a table
 
Join Date: Apr 2019
Posts: 3
derridascat is on a distinguished road
Default VBA - Changing color of text in a single column of a table

Hey all,

I'm looking to write a VBA macro that searches the first column of all my tables in powerpoint, and switches a specific text to a different color. I.E. I'd like all my tables that have "Yes" in the first column to switch the text "Yes" to a different color then black font, as doing it manually is going to take a bit of time. Here's what I got so far, but I can't get figure out how to specify the first column only. Appreciate the help!


Option Explicit

Sub ChangeTextColors()

Dim oSl As Slide
Dim oSh As Shape
Dim lCol As Long
Dim lRow As Long
Dim x As Long


For Each oSl In ActivePresentation.Slides
For Each oSh In oSl.Shapes

If oSh.HasTable Then
With oSh.Table
For lCol = 1 To .Columns.Count
For lRow = 1 To .Rows.Count
With .Cell(lRow, lCol).Shape
If .HasTextFrame Then
If .TextFrame.HasText Then


If .TextFrame.TextRange = "YES" Then
.TextFrame.TextRange.Font.Color.RGB = RGB(255, 0, 0)
End If
End If
End If
End With
Next
Next
End With
End If

Next
Next

End Sub
Reply With Quote
 

Tags
vba change color, vba powerpoint



Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA - Changing color of text in a single column of a table Changing color of instructional text in a content control box Document Specialist Word 2 08-17-2018 05:25 AM
VBA - Changing color of text in a single column of a table VBA Table – Search All Tables - Find & Replace Text in Table Cell With Specific Background Color jc491 Word VBA 8 09-30-2015 06:10 AM
VBA - Changing color of text in a single column of a table documents saved with double column revert to single column when re-opened danw Word 6 04-08-2015 06:24 AM
How can I temporarily break a 3 column format in order to type a single column paragraph William P Word 1 01-04-2015 06:40 PM
Changing the color of the last column in a chart changes the legend met0813 PowerPoint 0 01-03-2014 09:02 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 12:39 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft