Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

select specific numbers from a column of numbers in excel

Posted on 2012-03-26
10
Medium Priority
?
269 Views
Last Modified: 2012-03-27
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.
0
Comment
Question by:gregfthompson
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 5
10 Comments
 
LVL 49

Expert Comment

by:Martin Liss
ID: 37769343
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
 

Author Comment

by:gregfthompson
ID: 37769418
Thanks MartinLiss.

Can you amend the file and attach?

Greg
0
 
LVL 49

Expert Comment

by:Martin Liss
ID: 37769426
I'm sorry but what file? Did you mean to attach one?
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

Author Comment

by:gregfthompson
ID: 37769446
I've amended the file to have the original column is now A.

Can you include the macro? File is attached.

Thanks,

Greg
0
 
LVL 49

Expert Comment

by:Martin Liss
ID: 37769451
Sorry but there's still no file attached. And I'm on my way out the door for the night… sorry.
0
 

Author Comment

by:gregfthompson
ID: 37769480
Sorry. Here it is.  I am unable to make it work.
Number-split.xlsm
0
 
LVL 49

Expert Comment

by:Martin Liss
ID: 37769497
I put data in col A and it worked just fine. Did you notice that it is code for a command button?
0
 

Author Comment

by:gregfthompson
ID: 37770623
Can you upload the file?
0
 
LVL 49

Accepted Solution

by:
Martin Liss earned 2000 total points
ID: 37771596
Okay here it is.Number-split.xlsm
0
 

Author Closing Comment

by:gregfthompson
ID: 37773556
Thank you!
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question