Results 1 to 12 of 12

Thread: Find & replace issue with Greek letter

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #5
    VBAX Regular
    Joined
    Oct 2022
    Posts
    27
    Location
    The attached document #3 has four sigmas: two regular ones "σ" (in the first two lines), and two final ones "ς" (in the last two lines); i.e., it contains four matches.

    If you run the macro from post #3 on this file, and answer "Yes" to replace each match when prompted, then it goes as follows.
    - First it does a loop in which it finds each of the four sigmas in turn; and in this loop, it replaces the final ones but doesn't replace the regular ones.
    - Then it does a second loop in which it finds only the two regular sigmas, and in this loop it does replace them.

    In other words, currently the user gets prompted once for each of the two final sigmas but twice for each of the two regular sigmas; i.e., four prompts in the first loop resulting in two replacements (the two final sigmas), and two prompts in the second loop resulting in two replacements (the two regular sigmas), so six prompts altogether resulting in four replacements.

    I'm wondering what your suggested addition ("If AscW(Selection.Characters(1).Text) = AscW(.Text) ...") does to distinguish the two sigma forms, and why all four sigmas currently are not replaced the first time they are matched, and whether the code can be modified so that the user gets prompted once for each match; i.e., four prompts resulting in four replacements?

    Sigma test 3.docx
    Last edited by Harry88; 02-20-2023 at 06:26 PM.

Posting Permissions

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