Thread: [Solved] VBA help
View Single Post
 
Old 07-07-2011, 12:11 PM
needhelp2 needhelp2 is offline Windows XP Office 2007
Novice
 
Join Date: Jul 2011
Posts: 2
needhelp2 is on a distinguished road
Thumbs down VBA help

Hi guys,

I need to know how i can hit enter by using VBA after a specific word.
Kindly please confirm .I had record below script but unabel to get my result what i need.

I need to insert enter mean all record after </br> move to next time by using enter.

Br,
Smith.

Code:
Sub Macro1()
'
' Macro1 Macro
'
'
    Selection.Find.ClearFormatting
    With Selection.Find
        .Text = "<br/>"
        .Replacement.Text = ""
        .Forward = True
        .Wrap = wdFindContinue
        .Format = False
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    Selection.Find.Execute
    Selection.MoveRight Unit:=wdCharacter, Count:=1
    Selection.TypeParagraph
    Selection.Find.ClearFormatting
    With Selection.Find
        .Text = "<br/>"
        .Replacement.Text = ""
        .Forward = True
        .Wrap = wdFindContinue
        .Format = False
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    Selection.Find.Execute
    Selection.MoveLeft Unit:=wdCharacter, Count:=1
    Selection.TypeParagraph
    Selection.Find.ClearFormatting
    With Selection.Find
        .Text = "<br/>"
        .Replacement.Text = ""
        .Forward = True
        .Wrap = wdFindContinue
        .Format = False
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    Selection.Find.Execute
    Selection.MoveRight Unit:=wdCharacter, Count:=1
    Selection.TypeParagraph
End Sub
Reply With Quote