+ Reply to Thread
Results 1 to 8 of 8

replace some text on a string in a cell

  1. #1
    Registered User
    Join Date
    03-06-2013
    Location
    mexico
    MS-Off Ver
    Excel 2010
    Posts
    12

    Post replace some text on a string in a cell

    i have this string result from a query

    Camacho Mendoza MiguelAngel;#97;#Hernandez Ramos Felipe;#351;#Miguel Hernandez Nemesio;#87;#Garcia Reyes Sergio;#174;#Hernandez Tapia Ramon;#85;#Mendoza Galvez Victor;#137;#Izquierdo Munoz JoseAlfredo;#90;#Hernandez Garcia Sergio;#170
    those number ";#97;#" are from the id cause is a relational table i want to quit the id from them and replace it by , or ; would be ok so the string wouldbe like this


    Camacho Mendoza MiguelAngel, Hernandez Ramos Felipe, Miguel Hernandez Nemesio, Garcia Reyes Sergio, Hernandez Tapia Ramon, Mendoza Galvez Victor, Izquierdo Munoz JoseAlfredo, Hernandez Garcia Sergio

    can someone help me pls

  2. #2
    Valued Forum Contributor fredlo2010's Avatar
    Join Date
    07-04-2012
    Location
    Miami, United States
    MS-Off Ver
    Excel 365
    Posts
    762

    Re: replace some text on a string in a cell

    you dont need a macro try a find a replace

    Find What: ;#*;#
    Replace with: ,

    Thanks

  3. #3
    Registered User
    Join Date
    03-06-2013
    Location
    mexico
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: replace some text on a string in a cell

    well ty for ur info fredlo but i want it to do it automatically cause is a book with 30 queries every query is on one dif sheet and i have a concentrated and the thing is that the user just open the excel workbook and just c the concentrated so i really would appreciate if u tell me if there is a function to look and replace on a string in vba but anyway tu for ur help fredlo

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: replace some text on a string in a cell

    Hello ELFM,

    It would help to see your workbook. In the mean time, this macro will do what you want. This code must be placed in VBA Module. It will return the string (Text) with commas added in.
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

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

    Re: replace some text on a string in a cell

    Select the cell(s) and run the code
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    03-06-2013
    Location
    mexico
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: replace some text on a string in a cell

    leith ross Ty this code and ur time i will give u a star
    Last edited by ELFM; 03-09-2013 at 12:12 AM.

  7. #7
    Registered User
    Join Date
    03-06-2013
    Location
    mexico
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: replace some text on a string in a cell

    Jindom Brother u r really good at this thing that work really well ty for ur help i will study the code but that work really well so happy

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

    Re: replace some text on a string in a cell

    You are welcome.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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