![]() |
|
#3
|
|||
|
|||
|
Paul's method will work and be very fast for the specific example you gave. If you want a macro that simply deletes all but the first tab in each paragraph of text, you could use:
Code:
Sub ScratchMacro()
'A basic Word macro coded by Greg Maxey
Dim oPar As Paragraph
Dim oRng As Range
Dim lngIndex As Long
For Each oPar In ActiveDocument.Range.Paragraphs
lngIndex = 0
Set oRng = oPar.Range
With oRng.Find
.Text = Chr(9)
While .Execute
oRng.Select
lngIndex = lngIndex + 1
If lngIndex > 1 Then
oRng.Text = " "
oRng.Collapse wdCollapseEnd
End If
Wend
End With
Next oPar
lbl_Exit:
Exit Sub
End Sub
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
I need a macro to format images and remove tabs. help
|
LuisXVI | Word VBA | 4 | 11-12-2018 03:12 PM |
Macro to delete pages in Word 2007
|
staicumihai | Word VBA | 4 | 11-07-2018 01:14 AM |
Need Word Macro to Delete Text
|
rsrasc | Word VBA | 4 | 04-18-2018 11:32 PM |
| Tabs set along left edge of page; how to delete | ginny | Word | 4 | 03-21-2018 08:07 PM |
Word Macro to find and delete rows that contain adjacent cells containing "."
|
AlexanderJohnWilley | Word VBA | 7 | 11-08-2012 10:15 AM |