Can someone figure this out for me.

I have a column with addresses.  It has the st number and the street name... all in the same cell
I need to divide it up by street number and then street name.  I also need the street name to be all capitalized which currently it is not


what I have

     column a

144 main st
1789 elm st

what I would like

 Column a     column b
   144                  MAIN
   1789               ELM
jamesmetcalf74Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Kyle AbrahamsSenior .Net DeveloperCommented:
You can do a text to columns and split by space.

From there you can do an upper function on the new column.

Note that it won't handle situations like "N. Main" or anything like that, but should cover the majority of your situations.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Martin LissOlder than dirtCommented:
Here is a macro you can use. If you have headers, change the FIRST_DATA_ROW constant.


Sub SplitAddress()
Dim lngLastRow As Long
Dim lngRow As Long
Dim intPos As Integer
Const FIRST_DATA_ROW = 1

With ActiveSheet
    lngLastRow = .Range("A1048576").End(xlUp).Row
    For lngRow = FIRST_DATA_ROW To lngLastRow
        intPos = InStr(.Cells(lngRow, "A"), " ")
        .Cells(lngRow, "B") = UCase(Mid$(.Cells(lngRow, "A"), intPos + 1))
        .Cells(lngRow, "A") = Left$(.Cells(lngRow, "A"), intPos - 1)
        
    Next
End With

End Sub

Open in new window

Martin LissOlder than dirtCommented:
Just in case you need them, here are instructions on how to install and use the macro.

In Excel, Press Alt+F11 to open the Visual Basic Editor (VBE)

Right-click on your workbook name in the "Project-VBAProject" pane (at the top left corner of the editor window). If you don’t see an existing module then select Insert -> Module from the context menu. Otherwise just select the module.

Copy the macro (you can use the ‘Select All’ button if you like) and paste it into the right-hand pane of the VBA editor ("Module1" window)

Press Alt+F11 again to go back to Excel

Optionally, press Alt+F8 to open the "Macro" dialog window. Select the macro, click ‘Options…’,  hold down the Shift key and type the letter A (or any other letter) and click ‘OK’. Then anytime you want to run the macro press Ctrl+Shift+A.

When you close the workbook you will need to save it as an xlsm or xls file if it’s not already one of those.
Roy CoxGroup Finance ManagerCommented:
Assuming data is in column A

In B1   =LEFT(A1,FIND(" ",A1,1)-1)

In C1  =UPPER(RIGHT(A1,LEN(A1)-FIND(" ",A1,1)))

Then copy down
Split-Cells.xlsx
Martin LissOlder than dirtCommented:
I'm glad I was able to help.

In my profile you'll find links to some articles I've written that may interest you.
Marty - MVP 2009 to 2015, Experts-Exchange Top Expert Visual Basic Classic 2012 to 2014
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.