+ Reply to Thread
Results 1 to 10 of 10

To Delete specific letters from the cells

  1. #1
    Valued Forum Contributor abduljaleel.mca's Avatar
    Join Date
    02-13-2013
    Location
    Chennai, India
    MS-Off Ver
    MS 365 Business
    Posts
    326

    To Delete specific letters from the cells

    Hi,

    Below is my partial programming code

    Please Login or Register  to view this content.
    Using some condition I am getting the address of a cell. My program show a output of 'C' according to the data I have. Now I need to delete the char 'c' in all cells. The problem is below

    my program works suppose if char 'c' appear as a single char in a cell.
    It does not work in the combination of characters.

    C -> It works
    NC -> It does not work

    Some programming modification needed in this line

    Please Login or Register  to view this content.
    Please help.
    Last edited by abduljaleel.mca; 04-15-2013 at 10:41 AM.

  2. #2
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: To Delete specific letters from the cells

    hi abduljaleel.mca, without clear understanding of the whole thing it is about, try this

    Please Login or Register  to view this content.

  3. #3
    Valued Forum Contributor abduljaleel.mca's Avatar
    Join Date
    02-13-2013
    Location
    Chennai, India
    MS-Off Ver
    MS 365 Business
    Posts
    326

    Re: To Delete specific letters from the cells

    Hi Watersev,

    It is not working fine. I have attached a example file.

    1. Please look at P6 it says 'O' and total 'O' column is blank. So I need to delete letter 'O'
    2. Please look at N21 and Q21, these cells have letter 'O'. I can able to delete letter 'O' in N21 since it is a single character. But I can't able to delete the letter which is in Q21 as it is a combination of characters.
    3. 2 letters (NO) is an example. It may be combination of many characters.
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: To Delete specific letters from the cells

    try this:

    Please Login or Register  to view this content.

  5. #5
    Valued Forum Contributor abduljaleel.mca's Avatar
    Join Date
    02-13-2013
    Location
    Chennai, India
    MS-Off Ver
    MS 365 Business
    Posts
    326

    Re: To Delete specific letters from the cells

    Thanks Watersev,
    But it deletes all the characters from the cell Q21 i.e., it removes both N and O. It should remove only O and should leave char N (and other characters if present) as it is.

  6. #6
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: To Delete specific letters from the cells

    the line posted does not remove enything it checks if the specified letter(s) is(are) available in the cell. The cell content is deleted by Selection.ClearContents I suppose.
    Example to remove all letters "O" from cell A1, A1= "NOAKJSO"
    Please Login or Register  to view this content.
    Result: A1= "NAKJS"
    Amend to suit your needs

  7. #7
    Valued Forum Contributor abduljaleel.mca's Avatar
    Join Date
    02-13-2013
    Location
    Chennai, India
    MS-Off Ver
    MS 365 Business
    Posts
    326

    Re: To Delete specific letters from the cells

    Hi watersev,

    Thanks for your help, but still it is not working. It may work in your worksheet however it is not in my worksheet which I attached yesterday.

  8. #8
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: To Delete specific letters from the cells

    the attached file has no code of yours, what is the cell reference for total 'O' column?

  9. #9
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: To Delete specific letters from the cells

    if the total row is row 21 (basing on the posted file), this would delete "O" letter:

    Please Login or Register  to view this content.

  10. #10
    Valued Forum Contributor abduljaleel.mca's Avatar
    Join Date
    02-13-2013
    Location
    Chennai, India
    MS-Off Ver
    MS 365 Business
    Posts
    326

    Re: To Delete specific letters from the cells

    Hi Watersev,

    I used your below code with some modifications in my code

    Please Login or Register  to view this content.
    Now I am getting my expected result, Thanks for your help.

+ 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