+ Reply to Thread
Results 1 to 10 of 10

Replace ~ in a string according to criteria

  1. #1
    Forum Contributor
    Join Date
    11-12-2007
    Location
    Germany
    MS-Off Ver
    2007
    Posts
    472

    Replace ~ in a string according to criteria

    Hi,
    i need to process a word list which looks like:

    __________________________
    Now is:
    __________________________
    abondance ~s
    abondant, ante
    abonder
    .....~ dans le sens de qqn.
    abonnement
    abonner (1)
    .....s'~
    abonné, ée
    abord
    .....au premier ~ de prime ~
    .....aux ~s
    .....d'~
    abordable
    abordage
    ____________________________
    _____________________________

    Now i need tildas "~" of those cells to be replaced, which start with 5 spaces. The ~s have to be replaced by the string of the last cell without ~ and 5 spaces at the start. Only that part of cell has to be pasted in place of ~ which is not between "()".


    __________________________
    should be:
    __________________________
    abondance ~s................no change because it doesnt start with 5 spaces
    abondant, ante
    abonder
    .....abonder dans le sens de qqn.
    abonnement
    abonner (1).........those parts of string which are in () should not be pasted
    .....s'abonner
    abonné, ée
    abord
    .....au premier abord de prime abord
    .....aux abords
    .....d'abord
    abordable
    abordage
    ____________________________
    _____________________________


    I will be thankful for each idea or solution.replace_tilda_with_upper_word.xlsmreplace_tilda_with_upper_word.xlsm
    Last edited by wali; 12-10-2015 at 06:41 AM.

  2. #2
    Forum Contributor
    Join Date
    09-28-2014
    Location
    harbin,china
    MS-Off Ver
    2007
    Posts
    162

    Re: Replace ~ in a string according to criteria

    Hi, Wali

    Hope this is the code
    Please Login or Register  to view this content.
    Attached Files Attached Files

  3. #3
    Forum Contributor
    Join Date
    11-12-2007
    Location
    Germany
    MS-Off Ver
    2007
    Posts
    472

    Re: Replace ~ in a string according to criteria

    hi, simcode
    thank you very much. It doesn't replace all ~s as i tried it on larger list. I am uploading the large list. It will be kind if you could have a look at it.
    Attached Files Attached Files
    Last edited by wali; 12-10-2015 at 02:32 PM. Reason: replacing sensible data file with dummy data file

  4. #4
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Replace ~ in a string according to criteria

    Maybe:

    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    11-12-2007
    Location
    Germany
    MS-Off Ver
    2007
    Posts
    472

    Re: Replace ~ in a string according to criteria

    Hi, John H. Davis
    thank you for help. When i run the code, no tilda is replaced at all. I mean it makes no changes at all.

  6. #6
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Replace ~ in a string according to criteria

    I think this will do what you want. You should adjust the range where the result is put.
    Please Login or Register  to view this content.
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  7. #7
    Forum Contributor
    Join Date
    09-28-2014
    Location
    harbin,china
    MS-Off Ver
    2007
    Posts
    162

    Re: Replace ~ in a string according to criteria

    Please Login or Register  to view this content.

  8. #8
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: Replace ~ in a string according to criteria

    Should be like this.
    Please Login or Register  to view this content.

  9. #9
    Forum Contributor
    Join Date
    11-12-2007
    Location
    Germany
    MS-Off Ver
    2007
    Posts
    472

    Re: Replace ~ in a string according to criteria

    Solved!

    thank to you all guys. You saved me a lot of time. I was supposed to replace over 40 000 tildas manually and one by one! :-) Just imagine how important your help was!
    Excel is cool! this forum and its contributes are cool! thanks

  10. #10
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: Replace ~ in a string according to criteria

    You are welcome and thanks for the rep.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Need help with REPLACE function to replace HEX A0 with HEX 20 in string
    By flyboy54 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-26-2013, 12:52 PM
  2. [SOLVED] Replace string with another string from another worksheet (like decode)
    By sugee in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-27-2013, 02:05 AM
  3. [SOLVED] replace string with alternate string
    By seancain99 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 04-03-2013, 10:13 AM
  4. [SOLVED] Find a string by VBA Regular Expression and replace a part of that string
    By taps in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-25-2013, 11:08 AM
  5. Need Help Getting My String.Replace and Dim as String working
    By Johnathan in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-29-2012, 12:00 PM
  6. How to Assign Value to a String & Replace String With Assigned Value?
    By xiaokang1982 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-23-2012, 06:01 PM
  7. Replies: 3
    Last Post: 08-10-2006, 07:20 PM

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.6.0 RC 1