![]() |
|
|
|
#1
|
||||
|
||||
|
First of all the first set of brackets is superfluous
Find: ^13([a-z]) Replace: \1 would achieve the same result - http://www.gmayor.com/replace_using_wildcards.htm As for a macro, select the text that you wish to process and run Code:
Sub RemoveParaOrLineBreaks()
Dim oRng As Range
Dim oFind As Range
Set oRng = Selection.Range
Set oFind = Selection.Range
With oFind.Find
Do While .Execute(FindText:="[^13^l]{1,}", MatchWildcards:=True)
If oFind.InRange(oRng) Then
oFind.Text = ""
End If
Loop
End With
Set oFind = oRng
'Optionally remove additional spaces
With oFind.Find
Do While .Execute(FindText:="[ ]{2,}", MatchWildcards:=True)
If oFind.InRange(oRng) Then
oFind.Text = Chr(32)
oFind.Collapse 0
End If
Loop
End With
'end of option
lbl_Exit:
Set oRng = Nothing
Set oFind = Nothing
Exit Sub
End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com Last edited by gmayor; 05-28-2015 at 05:02 AM. |
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Can't delete page break
|
John Holstein | Word | 5 | 04-01-2015 09:00 AM |
| Line break between en dash and number | 90-degree | Word | 1 | 01-14-2015 01:09 PM |
How can I remove line break from 4 dash's
|
nmss18 | Word | 2 | 09-11-2014 06:07 AM |
delete page break
|
seeker62 | Word | 3 | 07-22-2013 06:49 PM |
Delete Page Break using VBA
|
wordpunk | Word VBA | 1 | 07-03-2012 03:05 PM |