select specific numbers from a column of numbers in excel

There is a column of numbers like this "19840: [6396".  I am seeking a script that will copy the last four numbers into a separate column.
gregfthompsonAsked:
Who is Participating?
 
Martin LissOlder than dirtCommented:
Okay here it is.Number-split.xlsm
0
 
Martin LissOlder than dirtCommented:
Assuming the data is in col A and you want the new data in B then…


Private Sub CommandButton1_Click()
Dim r As Range
Dim i As Long

Set r = Range("A1").End(xlDown).Offset(0, 0)
For i = 1 To r.Row

    Range("B" & i).Value = Right(Range("A" & i).Value, 4)

Next

End Sub
0
 
gregfthompsonAuthor Commented:
Thanks MartinLiss.

Can you amend the file and attach?

Greg
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
Martin LissOlder than dirtCommented:
I'm sorry but what file? Did you mean to attach one?
0
 
gregfthompsonAuthor Commented:
I've amended the file to have the original column is now A.

Can you include the macro? File is attached.

Thanks,

Greg
0
 
Martin LissOlder than dirtCommented:
Sorry but there's still no file attached. And I'm on my way out the door for the night… sorry.
0
 
gregfthompsonAuthor Commented:
Sorry. Here it is.  I am unable to make it work.
Number-split.xlsm
0
 
Martin LissOlder than dirtCommented:
I put data in col A and it worked just fine. Did you notice that it is code for a command button?
0
 
gregfthompsonAuthor Commented:
Can you upload the file?
0
 
gregfthompsonAuthor Commented:
Thank you!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.