+ Reply to Thread
Results 1 to 5 of 5

edit and replace a text string in within a cell

  1. #1
    Registered User
    Join Date
    10-05-2010
    Location
    Wisconsin
    MS-Off Ver
    Excel 2013
    Posts
    5

    edit and replace a text string in within a cell

    Greetings fellow Excel workers!

    I have been searching for a solution but can't seem to find one regarding an issue that I have with a report that is being exported into Excel.

    The report will export info into the first three columns in Excel, customer ID/name, and then two columns of numbers/percentages, something like:


    Cell A1 Cell B1 Cell C1
    ABC - ABC Co., LLC $xxxxx.xx 45%
    Anderson - Anderson Technology, Inc. $xxxxx.xx 55%

    I would like to edit the first columnn and remove the client ID portion only leaving the client name portion in the cell, or like this:

    ABC Co., LLC $xxxx.xx 45%
    Anderson Technology, Inc. $xxxx.xx 55%


    This cell will always contain the character "-" which shold allow for the constant to perform the edit. I do use, and keep, the "-" in other portions of the report, so the macro can't look at the entire worksheet. I'm looking for a macro to allow me to enter in the range, or number of rows in column 1 to make this edit; the number of rows will vary from month to month report to report.

    Any ideas anyone? Thanks in advance, as always, for your help!

    Mark
    Last edited by mtojek; 02-09-2012 at 10:57 AM.

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,592

    Re: edit and replace a text string in within a cell

    Here, try this:

    =TRIM(MID(A1, FIND("-", C22&"-")+1,255))

  3. #3
    Registered User
    Join Date
    01-20-2012
    Location
    Montreal
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: edit and replace a text string in within a cell

    have you tried the Left(), right() and mid() formulas?

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: edit and replace a text string in within a cell

    If there is only one dash in column A, you can do an Edit|Replace and enter Find What: *- (that is asterisk, dash, space) and in the Replace with, leave it blank.

    Click Replace All.

    Otherwise, you need a formula in another column... =TRIM(MID(A2,FIND("-",A2)+1,255)) copied down... then you can copy and paste special >> Values over column A.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  5. #5
    Registered User
    Join Date
    10-05-2010
    Location
    Wisconsin
    MS-Off Ver
    Excel 2013
    Posts
    5

    Re: edit and replace a text string in within a cell

    Thanks Zbor

    benedicttexcel; I'm not familiar with those, but I will research them; thanks!

    NBVC - that worked out real good; all I had to do was to go into the search/replace options ans selet the edit to only search one column since I do use and need the "-" character in other places in the same worksheet.

    Thanks everyone for your help and quick response!

    Mark
    Last edited by mtojek; 02-09-2012 at 10:55 AM.

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