Results 1 to 5 of 5

Thread: Macro to remove range of unicode characters

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    I will make it easier:

    A simple replacement macro is like this:

    Sub Replacement()
    ' Replacement Macro
    Selection.Find.ClearFormatting
        Selection.Find.Replacement.ClearFormatting
        With Selection.Find
            .Text = "^u01000"
            .Replacement.Text = ""
            .Forward = True
            .Wrap = wdFindStop
                End With
        Selection.Find.Execute Replace:=wdReplaceAll
    End Sub
    Now, how can I change it to replace all the unicode values from ^u01000 to ^u01100?

    Maybe it could be done by creating a variable "n" with a value 01000 and after wdReplaceAll n=n+1, and adding a loop do while u<01101 . But how should I modify .Text = "^u01000" ? if I write "^u0n" I suppose it will not understand that n means my variable.
    Thank you
    Last edited by Aussiebear; 08-01-2022 at 01:08 PM. Reason: Added code tags to supplied code

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •