Results 1 to 10 of 18

Thread: Extract numbers from text into multiple columns

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Junior Member
    Join Date
    Sep 2015
    Posts
    10
    Rep Power
    0
    I have entered the code and run it but it seems to leave an empty cell?

  2. #2
    Forum Guru Rick Rothstein's Avatar
    Join Date
    Feb 2012
    Posts
    662
    Rep Power
    15
    Does this macro do what you want...
    Code:
    Sub SplitOutNumbers() Dim R As Long, X As Long, LastRow As Long, Text As Variant, Results As Variant LastRow = Cells(Rows.Count, "A").End(xlUp).Row For R = 1 To LastRow Text = Cells(R, "B").Value For X = 1 To Len(Text) If Mid(Text, X, 1) Like "[!0-9]" Then Mid(Text, X) = " " Next Text = Split(Application.Trim(Text), " ", 2) Cells(R, "C").Resize(, 4).Value = Array(Text(0), Mid(Text(1), 4), Mid(Text(1), 5, 4), Right(Text(1), 1)) Next End Sub
    Last edited by Rick Rothstein; 10-03-2015 at 12:02 AM.

Similar Threads

  1. Extract Only Numbers & TEXT From Text String
    By mahmoud-lee in forum Excel Help
    Replies: 9
    Last Post: 11-02-2013, 02:49 PM
  2. Replies: 4
    Last Post: 05-01-2013, 09:49 PM
  3. Replies: 2
    Last Post: 09-24-2012, 09:20 PM
  4. Extract numbers from alphanumeric values
    By tushar.tarafdar in forum Excel Help
    Replies: 3
    Last Post: 09-20-2012, 10:16 PM
  5. VBA Function To Extract Decimal Numbers
    By PcMax in forum Excel Help
    Replies: 7
    Last Post: 11-19-2011, 09:42 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •