Home |
Search |
Today's Posts |
#9
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Fri, 13 Apr 2007 08:03:40 -0400, Ron Rosenfeld
wrote: On Fri, 13 Apr 2007 03:19:51 -0700, Les Stout wrote: Hi Keri, try this Sub single_Split() ' Dim x As String, s As Variant x = Range("A4") s = Split(x, " ") Range("B5").Value = s(0) Range("C5").Value = s(1) Range("D5").Value = s(2) Range("E5").Value = s(3) End Sub Les Stout *** Sent via Developersdex http://www.developersdex.com *** Just as an additional note (I hit send too quickly), the Split function, as a default, will use <space as the delimiter and also return all of the strings, so the following routine is equivalent and a bit shorter: =============================================== Option Explicit Sub ParseString() Dim rSrc As Range Dim rDest As Range Dim Temp As Variant Dim i As Long Set rSrc = Range("A4") Set rDest = Range("B5") Temp = Split(rSrc.Text) For i = 0 To UBound(Temp) rDest.Offset(0, i).Value = Temp(i) Next i End Sub =============================================== = --ron This is out of order and should be a followup response to keri's post. --ron |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to split number and text string to separate cells? | Excel Discussion (Misc queries) | |||
Seperate cell string into individual cells | Excel Worksheet Functions | |||
Split Cell Into Seperate Rows | Excel Programming | |||
Seperate/Split celinput | Excel Worksheet Functions | |||
Need to convert text string to seperate cells | Excel Worksheet Functions |