+ Reply to Thread
Results 1 to 4 of 4

Remove last character if length is greater than 6

  1. #1
    Forum Contributor
    Join Date
    05-30-2021
    Location
    Colorado Springs
    MS-Off Ver
    Microsoft 365
    Posts
    173

    Remove last character if length is greater than 6

    Hello All,

    I would be grateful for some help on a macro that simply looks at Column K, starting at K2, to identify values with length greater than 6 and if found, remove last character. Demo file with desired results attached. Thanks for considering!

  2. #2
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Cool Hello, try this !


    According to your attachment a VBA demonstration for starters :

    PHP Code: 
    Sub Demo1()
        
    With Range("K2", [K1].End(xlDown)):  .Value2 Evaluate("IF({1},LEFT(" & .Address ",6))"):  End With
    End Sub 
    ► Do you like it ? ► So thanks to click on bottom left star icon « Add Reputation » !

  3. #3
    Forum Contributor
    Join Date
    05-30-2021
    Location
    Colorado Springs
    MS-Off Ver
    Microsoft 365
    Posts
    173

    Re: Remove last character if length is greater than 6

    Perfect. Thanks for your help.

  4. #4
    Forum Expert
    Join Date
    10-11-2021
    Location
    Netherlands
    MS-Off Ver
    365
    Posts
    1,381

    Re: Remove last character if length is greater than 6

    Please Login or Register  to view this content.

    Please Login or Register  to view this content.

+ 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: 12
    Last Post: 02-07-2020, 03:51 AM
  2. Cell length formula to remove any characters over 31 in length
    By tehkayd in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-02-2015, 11:45 AM
  3. Replies: 3
    Last Post: 11-20-2012, 10:03 PM
  4. 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
  5. Replies: 3
    Last Post: 12-12-2005, 07:45 AM
  6. Replies: 1
    Last Post: 04-18-2005, 05:06 PM
  7. Replies: 1
    Last Post: 04-17-2005, 08:10 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