Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 08-14-2013, 06:35 PM
dylansmith dylansmith is offline best way to use search/replace wildcards in this scenario? Windows 8 best way to use search/replace wildcards in this scenario? Office 2013
Optimizer
best way to use search/replace wildcards in this scenario?
 
Join Date: Nov 2011
Posts: 144
dylansmith is on a distinguished road
Default best way to use search/replace wildcards in this scenario?


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?
Reply With Quote
  #2  
Old 08-15-2013, 07:10 AM
JohnWilson JohnWilson is offline best way to use search/replace wildcards in this scenario? Windows 7 64bit best way to use search/replace wildcards in this scenario? Office 2010 32bit
Programmer
 
Join Date: Nov 2008
Location: UK
Posts: 1,912
JohnWilson has a spectacular aura aboutJohnWilson has a spectacular aura about
Default

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
__________________
Microsoft PowerPoint MVP 2007-2023
Free Advanced PowerPoint Tips and Tutorials
Reply With Quote
  #3  
Old 07-13-2019, 07:06 AM
KarenK13 KarenK13 is offline best way to use search/replace wildcards in this scenario? Windows 10 best way to use search/replace wildcards in this scenario? Office 2013
Novice
 
Join Date: Jul 2019
Posts: 6
KarenK13 is on a distinguished road
Default PowerPoint VBA Macro to change font of words between quotes to italic

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.
Reply With Quote
  #4  
Old 03-04-2023, 08:55 PM
Dr DP Dr DP is offline best way to use search/replace wildcards in this scenario? Windows 10 best way to use search/replace wildcards in this scenario? Office 2021
Novice
 
Join Date: Mar 2023
Posts: 1
Dr DP is on a distinguished road
Default search/replace will kill format

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.
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
best way to use search/replace wildcards in this scenario? search and replace 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
best way to use search/replace wildcards in this scenario? Word 2010: Wildcards Replace 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

Other Forums: Access Forums

All times are GMT -7. The time now is 10:03 PM.


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