+ Reply to Thread
Results 1 to 4 of 4

Thread: Word find-replace operation

  1. #1
    Registered User
    Join Date
    06-09-2009
    Location
    Greece
    MS-Off Ver
    Excel 2003/2007
    Posts
    79

    Word find-replace operation

    Hi,

    I am trying to do a find-replace with wildcards that will match strings like:

    την νομίζω
    ΤΗΝ ΝΟΜΙΖΩ
    Την μαρία
    στην Μαρία
    Στην Μαρία
    ΣΤΗΝ ΜΑΡΙΑ

    but will not match strings like:

    την ντουντούκα
    ΤΗΝ ΝΤΟΥΝΤΟΥΚΑ
    Την Ντουντούκα
    στην μπάντα
    Στην Μπάντα
    ΣΤΗΝ ΜΠΑΝΤΑ

    I have used this find string:

    ([Ττ][Ηη])([Νν])( )([μν ΜΝ])

    how can I adapt it so that it keeps matching words staring with "μ" or "ν" but does not match words starting with "μπ" or "ντ"?

  2. #2
    Extremely Helpful member
    Join Date
    12-23-2006
    Location
    Belgium
    MS-Off Ver
    XL2003
    Posts
    6,127

    Re: Word find-replace operation

    Maybe this link will provide help ?
    Quoting entire posts clutters the forum and makes threads hard to read !

    If you are pleased with a member's answer then use the Star icon to rate it

    Click here to see forum rules

  3. #3
    Registered User
    Join Date
    06-09-2009
    Location
    Greece
    MS-Off Ver
    Excel 2003/2007
    Posts
    79

    Re: Word find-replace operation

    Thanks, I know this page. I could use the [!] symbol, i.e.:

    ([Ττ][Ηη])([Νν])( )(μ[!π])

    but as I understand I would have to break the string in 2 different find/replace operations (and I need to add more similar operations), so I was wondering whether it could be done in a more compact way.

  4. #4
    Forum Guru snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,151

    Re: Word find-replace operation

    You'd better use the VBA replace (without wildcards)

     
    sub snb()
     with activedocument
      .content=replace(replace(.lcase("την ν","tin P"),"την ν","stin P")
     end with
    end sub



+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.2.0