![]() |
#1
|
|||
|
|||
![]()
i have a set of slides where there are certain info i wish to censor. some textboxes will display $345/mth, or $68,400/mth, $40/h, $500/day.
how do i replace these with blanks quickly using search and replace? ![]() |
#2
|
|||
|
|||
![]()
PowerPoint search doesn't support wildcards as Word does.
You could use a macro though Sub use_regex() Dim regX As Object Dim osld As Slide Dim oshp As Shape Dim strInput As String Dim b_found As Boolean Dim iRow As Integer Dim iCol As Integer Set regX = CreateObject("vbscript.regexp") With regX .Global = True .Pattern = "(\$)\d+\,*\d*\,*\d*(/)" End With For Each osld In ActivePresentation.Slides For Each oshp In osld.Shapes If oshp.HasTable Then For iRow = 1 To oshp.Table.Rows.Count For iCol = 1 To oshp.Table.Columns.Count strInput = oshp.Table.Cell(iRow, iCol).Shape.TextFrame.TextRange.Text b_found = regX.Test(strInput) If b_found = True Then strInput = regX.Replace(strInput, "$1***$2") oshp.Table.Cell(iRow, iCol).Shape.TextFrame.TextRange = strInput End If Next iCol Next iRow Else If oshp.HasTextFrame Then If oshp.TextFrame.HasText Then strInput = oshp.TextFrame.TextRange.Text b_found = regX.Test(strInput) If b_found = True Then strInput = regX.Replace(strInput, "$1***$2") oshp.TextFrame.TextRange = strInput End If End If End If End If Next oshp Next osld Set regX = Nothing End Sub Should work How to use |
#3
|
|||
|
|||
![]()
PowerPoint VBA Macro to change font of words between quotes to italic needed. The code below would be perfect but I do not know how to manipulate it to change to italic. Thanks in advance for any help.
|
#4
|
|||
|
|||
![]()
In case you land on this question in 2023.
JohnWilson's macro code is good, but it has a major flaw (it's MS, not really JohnWilson). It will mess up the formatting for any text that it replaces (bold, italics, underline, font size etc. will change to the text just before the pattern being replaced). Unless you have a Powerpoint with no formatting, this macro has limited use in the real world. The worse news is that there is no easy / good solution to that problem. |
![]() |
Thread Tools | |
Display Modes | |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
dirkoo | Word VBA | 2 | 08-14-2013 11:25 AM |
wildcards in find & replace to reverse word order | jeffk | Word | 3 | 11-11-2012 01:47 PM |
![]() |
tinfanide | Word | 2 | 09-10-2011 10:40 AM |
Any wildcards search and replace in Powerpoint 2010? | tinfanide | PowerPoint | 0 | 09-10-2011 02:17 AM |
Search and Replace - Clear Search box | JostClan | Word | 1 | 05-04-2010 08:46 PM |