Results 1 to 5 of 5

Extract last numbers in a column of varying lengths/formats

Threaded View

  1. #1
    Registered User
    Join Date
    10-25-2017
    Location
    United States
    MS-Off Ver
    2019
    Posts
    77

    Extract last numbers in a column of varying lengths/formats

    I have list of product names that I would like to extract the last numbers from. I have macro currently that does it for me, but the problem is the user has to enable macros for it to work. I am looking for a formula to take the place of this macro:
    Function LastNum(s As String) As Long
      Static RX As Object
      
      If RX Is Nothing Then
        Set RX = CreateObject("VBScript.RegExp")
        RX.Global = True
      End If
      RX.Pattern = "[\d,]+(?=\D*$)"
      LastNum = RX.Execute(s)(0)
    End Function
    Attached is the workbook, thank you!
    Attached Files Attached Files
    Last edited by AliGW; 10-25-2018 at 12:18 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Extract last numbers in a column of varying lengths/formats
    By Stuepef in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-06-2018, 11:40 AM
  2. [SOLVED] Extract all numbers from cells with varying lengths
    By Stuepef in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 04-04-2018, 02:47 AM
  3. [SOLVED] Need a macro to sum or subtotal ranges of varying lengths in a column
    By zookeepertx in forum Excel Programming / VBA / Macros
    Replies: 19
    Last Post: 05-12-2014, 06:14 AM
  4. [SOLVED] Extract numbers of variable lengths from cell
    By Nizz in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 10-18-2013, 10:11 AM
  5. Replies: 3
    Last Post: 05-09-2012, 11:36 AM
  6. Replies: 2
    Last Post: 09-20-2010, 05:55 AM
  7. Fill down formula using VBA to varying column lengths
    By Lee Jeffery in forum Excel - New Users/Basics
    Replies: 0
    Last Post: 01-28-2005, 08:40 PM

Tags for this Thread

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