Bonjour,
Dans son message, < Tonya Marshall > écrivait :
In this message, < Tonya Marshall > wrote:
|| Copying and pasting text from a web page or an email frequently replaces
|| tabs with numerous spaces. Is there a way to replace > 1 space with a
tab?
|| --
|| Tonya Marshall
|| tonz AT harborside DOT com
Try this:
'_______________________________________
Sub ReplaceSpacesByTabs()
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
'Find between 2 and 100 consecutive spaces
'Increase 100 to the maximum number of spaces you think
'you need to replace
.Text = " {2,100}"
.Replacement.Text = "^t"
.Forward = True
.Wrap = wdFindContinue
.Format = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
'To reset the browser
Application.Browser.Target = wdBrowsePage
End Sub
'_______________________________________
--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site:
http://www.word.mvps.org