View Single Post
 
Old 01-01-2024, 11:26 AM
RobiNew RobiNew is offline Windows 10 Office 2016
Competent Performer
 
Join Date: Sep 2023
Posts: 183
RobiNew is on a distinguished road
Default

Hi, Vivka! I'm trying to move until a specific character, but my code seems to be wrong. Can you help? Thanks!
Code:
Sub MovingChr()
Set oRng = ActiveDocument.Range
    With oRng.Find
    .Text = "<p class=MyPar>"
    .Execute
    End With
oRng.Collapse wdCollapseEnd
'If Selection is between > and < then move on to next <
If oRng.Characters.First = "<" Then
oRng.Collapse wdCollapseEnd
oRng.Select
      oRng.MoveEndUntil Cset:="<"
          oRng.Select
End If
End Sub
Reply With Quote