Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
How would I write a macro that would split up an addrss by spaces? Lets say
the address is 1364 W elm street apt #4? I am new to coding so I dont know where to start. Also I need the macro to run down the list until there is no address to move. Any help would be greatly appreciated, thanks Neal. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I suggest you start by recording a macro of you using the text to
columns function and using a space as your delimitor. From there you can see the code and play with it from there. Neal wrote: How would I write a macro that would split up an addrss by spaces? Lets say the address is 1364 W elm street apt #4? I am new to coding so I dont know where to start. Also I need the macro to run down the list until there is no address to move. Any help would be greatly appreciated, thanks Neal. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
or try this 1 i got from mr. bak
Sub test() Dim rCell As Range For Each rCell In Selection rCell(1, 2).Resize(, 6) = Split(rCell, " ") Next End Sub |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
remember select ur adress cells, - and run kode
" skrev: I suggest you start by recording a macro of you using the text to columns function and using a space as your delimitor. From there you can see the code and play with it from there. Neal wrote: How would I write a macro that would split up an addrss by spaces? Lets say the address is 1364 W elm street apt #4? I am new to coding so I dont know where to start. Also I need the macro to run down the list until there is no address to move. Any help would be greatly appreciated, thanks Neal. |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thank you it works great.
"excelent" wrote: remember select ur adress cells, - and run kode " skrev: I suggest you start by recording a macro of you using the text to columns function and using a space as your delimitor. From there you can see the code and play with it from there. Neal wrote: How would I write a macro that would split up an addrss by spaces? Lets say the address is 1364 W elm street apt #4? I am new to coding so I dont know where to start. Also I need the macro to run down the list until there is no address to move. Any help would be greatly appreciated, thanks Neal. |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
How do I avoid getting a null value in the remainding cells. Not every
address will have 6 cells to populate?Is there a way to write it out to stop after it hits a blank spot? "excelent" wrote: remember select ur adress cells, - and run kode " skrev: I suggest you start by recording a macro of you using the text to columns function and using a space as your delimitor. From there you can see the code and play with it from there. Neal wrote: How would I write a macro that would split up an addrss by spaces? Lets say the address is 1364 W elm street apt #4? I am new to coding so I dont know where to start. Also I need the macro to run down the list until there is no address to move. Any help would be greatly appreciated, thanks Neal. |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub test()
Dim c, cCount Dim rCell As Range For Each rCell In Selection For c = 1 To Len(rCell) If Mid(rCell, c, 1) = " " Then cCount = cCount + 1 Next rCell(1, 2).Resize(, cCount + 1) = Split(rCell, " "): cCount = 0 Next End Sub |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This worked great. I had one question about assigning a range. Would i enter
it under the dim rcell as range, and would it be range("A1").select? Thanks for the help. "excelent" wrote: Sub test() Dim c, cCount Dim rCell As Range For Each rCell In Selection For c = 1 To Len(rCell) If Mid(rCell, c, 1) = " " Then cCount = cCount + 1 Next rCell(1, 2).Resize(, cCount + 1) = Split(rCell, " "): cCount = 0 Next End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Splitting up address | Excel Discussion (Misc queries) | |||
Splitting Address Info - Text to Columns | Excel Discussion (Misc queries) | |||
Splitting Numeric data from Text (Street Address Help) | Excel Discussion (Misc queries) | |||
Splitting comma separated lines of an address for mail merge. | Excel Discussion (Misc queries) | |||
LINKING Address cells from an EXCEL spreadsheet to fill MapQuest Address Info | Excel Programming |