+ Reply to Thread
Results 1 to 9 of 9

VB Code to find and delete and Truncate cell length

  1. #1
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    VB Code to find and delete and Truncate cell length

    Hello:

    Please refer to attached file.
    I need VB Code to do following.
    Go thru column C and delete non-numeric cells. (Delete "XYZ" and "CENETER")
    Go thru Column D and do following
    Delete all numeric numbers
    Delect "*" character
    Truncate cell content to 20 character.

    Let me know if you have any questions.
    Thanks.
    Attached Files Attached Files

  2. #2
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: VB Code to find and delete and Truncate cell length

    Give this a try (I assumed you don't want to actually delete cells in column C, but just clear the contents?):

    Please Login or Register  to view this content.
    Please help by:

    Marking threads as closed once your issue is resolved. How? The Thread Tools at the top
    Any reputation (*) points appreciated. Not just by me, but by all those helping, so if you found someone's input useful, please take a second to click the * at the bottom left to let them know

    There are 10 kinds of people in this world... those who understand binary, and those who don't.

  3. #3
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,080

    Re: VB Code to find and delete and Truncate cell length

    Another option
    Please Login or Register  to view this content.

  4. #4
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: VB Code to find and delete and Truncate cell length

    @Fluff13, kudos, much better approach.

  5. #5
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    Re: VB Code to find and delete and Truncate cell length

    Hello ALL:

    Thanks a lot, yes FLUFF Solution is better approach.

    Riz

  6. #6
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,080

    Re: VB Code to find and delete and Truncate cell length

    Glad we could help & thanks for the feedback.

  7. #7
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    Re: VB Code to find and delete and Truncate cell length

    Hello Fluff

    I need to tweek the code as below.
    Assume that column C contents is all numeric.
    In this case the code gives error at

    Please Login or Register  to view this content.
    Can you please help modify the code to acomodate in this situation also.
    Thanks a lot

    Riz

  8. #8
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,080

    Re: VB Code to find and delete and Truncate cell length

    Try
    Please Login or Register  to view this content.

  9. #9
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    Re: VB Code to find and delete and Truncate cell length

    Hello Fluff

    Thanks a lot, will try as i use the system and let you know if any further requirement.

    Riz

+ 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. Replies: 1
    Last Post: 01-31-2015, 06:41 AM
  2. Code look through range of cells, find blanks & delete cell range in the same row,
    By EagleInsight in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 01-10-2014, 11:24 AM
  3. Need to truncate a cell if the character length is over 100
    By Xaos in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-29-2013, 02:09 PM
  4. VBA code to find and delete cell contents based on userform combobox selections
    By anfdrew in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-06-2013, 04:13 PM
  5. If cell length greater than 7 then delete 3rd character
    By Rabbitstew in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 07-20-2012, 10:42 AM
  6. Replies: 4
    Last Post: 07-01-2012, 07:24 PM
  7. Truncate last two char on non fixed length cell
    By brusk in forum Excel General
    Replies: 4
    Last Post: 02-09-2010, 03:46 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