+ Reply to Thread
Results 1 to 8 of 8

Remove text after 4th decimal except specific text

  1. #1
    Registered User
    Join Date
    03-21-2022
    Location
    India
    MS-Off Ver
    Microsoft version 2201
    Posts
    22

    Remove text after 4th decimal except specific text

    Hello,
    I want to find and remove text from the rows in whole excel sheet except specific text after 4th decimal (dot).
    Please see attached excel and screenshot for your reference.
    In the Sheet1, Column A has many items. I want to retain “Ax.Frameworks.SysUtils.GlobalConsts.NON_ID” and “Ax.Frameworks.SysUtils.GlobalConsts.IGNORE_ID” as it is. Apart from those 2 items, if anything like, “Ax.Frameworks.SysUtils.GlobalConsts.XYZ”, “Ax.Frameworks.SysUtils.GlobalConsts.APPLE”, “Ax.Frameworks.SysUtils.GlobalConsts.RYH” .. etc should be changed to “Ax.Frameworks.SysUtils.GlobalConsts”, that is after 4th decimal it should remove all text.
    I have more than 1000 items in Column A.
    So I’m only looking vba/macros which will exclude those 2 items and the rest items should remove text after Ax.Frameworks.SysUtils.GlobalConsts, so please someone help.
    Please Note: The macros/vba should only work for type “Ax.Frameworks.SysUtils.GlobalConsts” and not for others like "Ax.Services.Common.Origination.DCContractSearchArgs", "Ax.Frameworks.ID.SysUtils.GlobalConsts", etc
    Forum23.PNG
    Forum23.xlsx
    Last edited by MohammedAsif10000; 03-22-2022 at 02:38 AM. Reason: Attachment missing

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

    Re: Remove text after 4th decimal except specific text

    For the data provided.
    Please Login or Register  to view this content.

  3. #3
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,459

    Re: Remove text after 4th decimal except specific text

    Try:
    PHP Code: 
    Option Explicit
    Sub test
    ()
    Dim Lr&, k&, cell As Rangesarr()
    Lr Cells(Rows.Count"B").End(xlUp).Row
    ReDim arr
    (1 To Lr 11 To 1)
        For 
    Each cell In Range("A2:A" Lr)
            
    1
            s 
    Split(cell "."".")
            If 
    s(4Like "NON_ID" Or s(4Like "IGNORE_ID" Then
                arr
    (k1) = cell.Value
            
    Else
                
    arr(k1) = s(0) & "." s(1) & "." s(2) & "." s(3)
            
    End If
        
    Next
    Range
    ("A2").Resize(k1).Value arr ' paste from A2. Can be adjusted to other area, i.e, "E2"
    End Sub 
    Quang PT

  4. #4
    Registered User
    Join Date
    03-21-2022
    Location
    India
    MS-Off Ver
    Microsoft version 2201
    Posts
    22

    Re: Remove text after 4th decimal except specific text

    Thanks a lot, works partially
    Last edited by MohammedAsif10000; 03-22-2022 at 02:19 AM.

  5. #5
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,459

    Re: Remove text after 4th decimal except specific text

    Which post #2 or #3 do your refer to? And does "works partiallly" means NOT fully working?

  6. #6
    Registered User
    Join Date
    03-21-2022
    Location
    India
    MS-Off Ver
    Microsoft version 2201
    Posts
    22

    Re: Remove text after 4th decimal except specific text

    Jindon's #2 working partially.. I have updated my post with Note.

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

    Re: Remove text after 4th decimal except specific text

    Change
    Please Login or Register  to view this content.
    to
    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    03-21-2022
    Location
    India
    MS-Off Ver
    Microsoft version 2201
    Posts
    22

    Re: Remove text after 4th decimal except specific text

    100% works ... thanks

+ 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. Find and remove text from the rows in whole excel sheet except specific text
    By MohammedAsif10000 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-21-2022, 03:58 PM
  2. Replies: 6
    Last Post: 11-15-2021, 08:24 AM
  3. Replies: 7
    Last Post: 03-29-2021, 01:53 PM
  4. [SOLVED] A Formula Which Turns Numbers Into Text With A Specific Decimal Number Amount
    By zanshin777 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-01-2018, 04:55 PM
  5. Want to Remove A Non-Specific Text Strand Between Two Specific Characters
    By predictablepanda in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-04-2013, 12:33 AM
  6. Remove decimal from number strings stored as text
    By lilianphoebs in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-24-2011, 02:32 PM
  7. Replies: 5
    Last Post: 04-29-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