Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro that takes words from a sentence and puts them in diff cells
I need a macro which takes every word from a sentence in a cell and puts it
in a different cell Example : A1 : Mother and father are gone on vacation What i need is a macro which does this : B1 : Mother C1 : and D1 : father E1 : are F1 : gone G1 : on H1 : vacation |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro that takes words from a sentence and puts them in diff cells
Hi,
Try this Sub Sonic() Dim V As Variant Dim S As String V = Split(Range("A1").Value, " ") For x = 0 To UBound(V) Cells(x + 1, 2) = V(x) Next End Sub Mike "andrei" wrote: I need a macro which takes every word from a sentence in a cell and puts it in a different cell Example : A1 : Mother and father are gone on vacation What i need is a macro which does this : B1 : Mother C1 : and D1 : father E1 : are F1 : gone G1 : on H1 : vacation |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro that takes words from a sentence and puts them in diff c
My mistake you wanted it in columns not roes
Sub Sonic1() Dim V As Variant Dim S As String V = Split(Range("A1").Value, " ") For x = 0 To UBound(V) Cells(1, x + 2) = V(x) Next End Sub Mike "Mike H" wrote: Hi, Try this Sub Sonic() Dim V As Variant Dim S As String V = Split(Range("A1").Value, " ") For x = 0 To UBound(V) Cells(x + 1, 2) = V(x) Next End Sub Mike "andrei" wrote: I need a macro which takes every word from a sentence in a cell and puts it in a different cell Example : A1 : Mother and father are gone on vacation What i need is a macro which does this : B1 : Mother C1 : and D1 : father E1 : are F1 : gone G1 : on H1 : vacation |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro that takes words from a sentence and puts them in diff c
Thanks ! It works now !
"Mike H" wrote: My mistake you wanted it in columns not roes Sub Sonic1() Dim V As Variant Dim S As String V = Split(Range("A1").Value, " ") For x = 0 To UBound(V) Cells(1, x + 2) = V(x) Next End Sub Mike "Mike H" wrote: Hi, Try this Sub Sonic() Dim V As Variant Dim S As String V = Split(Range("A1").Value, " ") For x = 0 To UBound(V) Cells(x + 1, 2) = V(x) Next End Sub Mike "andrei" wrote: I need a macro which takes every word from a sentence in a cell and puts it in a different cell Example : A1 : Mother and father are gone on vacation What i need is a macro which does this : B1 : Mother C1 : and D1 : father E1 : are F1 : gone G1 : on H1 : vacation |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
In excel, how do we pull the first letter from words in a sentence | Excel Worksheet Functions | |||
how you make links between diff. cells on diff. work sheets | Excel Worksheet Functions | |||
Not all words in sentence prints - row is set autofit HELP? | Excel Worksheet Functions | |||
Diff colours in same sentence inc a formula | Excel Discussion (Misc queries) | |||
make a sentence from words chosen at random | Excel Programming |