Hi, Column C has a bunch of addresses that have no spaces between the
number and street. (27smith lane instead of 27 smith lane). Is there
a way for me to quickly seperate the number and street name from the
preceding number in each cell of column c? There are 1075 cells in
column C. Thanks!
Easily done with a VBA Macro:
To enter this Macro (Sub), <alt-F11> opens the Visual Basic Editor.
Ensure your project is highlighted in the Project Explorer window.
Then, from the top menu, select Insert/Module and
paste the code below into the window that opens.
To use this Macro (Sub) as written, Select the range you wish to process. Then
<alt-F8> opens the macro dialog box. Select the macro by name, and <RUN>.
Note that this Macro will not change any addresses that do not start with
digits. Also, if there happens to be a space after the initial digits, it will
not add an extra space.
================================
Option Explicit
Sub SplitAddr()
Dim rg As Range, c As Range
Dim re As Object
Set re = CreateObject("vbscript.regexp")
With re
.Pattern = "^(\d+)\s?"
.Global = False
End With
Set rg = Selection 'or Whatever range you want to process
For Each c In rg
c.Value = re.Replace(c.Value, "$1 ")
Next c
End Sub
=========================
--ron