Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 02-02-2014, 06:22 PM
mrayncrental mrayncrental is offline Add asterisks in front of all bold sentences in a table cell Windows 7 64bit Add asterisks in front of all bold sentences in a table cell Office 2007
Novice
Add asterisks in front of all bold sentences in a table cell
 
Join Date: Feb 2014
Posts: 15
mrayncrental is on a distinguished road
Angry Add asterisks in front of all bold sentences in a table cell

Hi - I am trying to create a Word macro that searches a column in a table for all bold sentences and adds 2 asterisks at the beginning of each sentence. So far I have come up with the code below. But it only finds the first sentence over and over again. I will have cells that have more than 1 bold sentence so I don't want to use range and move from cell to cell because it ignores the other sentences.

Thanks in advance for your help!


Sum AsteriskText()

Dim keepSearch As Boolean

keepSearch = False

Selection.Tables(1).Columns(3).Select


Do
Selection.Find.ClearFormatting
Selection.Find.Font.Bold = True


With Selection.Find
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute


If Selection.Find.Found Then
keepSearch = True
Else
keepSearch = False
End If

With Selection
.InsertBefore "**"

End With


Loop While keepSearch


End Sub
Reply With Quote
 

Tags
macro table search

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Add asterisks in front of all bold sentences in a table cell Keep box drawn in front of Video in FRONT position a_gunslinger PowerPoint 1 04-18-2013 07:54 AM
Format Bold in one line makes all lines bold Nitte Word 2 02-07-2013 12:34 AM
asterisks turned into broken line -- can't get rid of gsjackson Word 3 12-02-2011 03:14 PM
Table of Authorities Entries - Zombie Bold emilypage Word 2 10-25-2011 06:56 AM
Auto-populate an MS Word table cell with text from a diff cell? dreamrthts Word Tables 0 03-20-2009 01:49 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 10:31 AM.


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