Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 53
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 53
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
In excel, how do we pull the first letter from words in a sentence Deepak Excel Worksheet Functions 7 February 4th 09 10:20 AM
how you make links between diff. cells on diff. work sheets NYC-MIKE Excel Worksheet Functions 3 February 11th 08 05:05 PM
Not all words in sentence prints - row is set autofit HELP? Marita Excel Worksheet Functions 0 January 14th 08 09:28 PM
Diff colours in same sentence inc a formula bookman3 Excel Discussion (Misc queries) 1 June 21st 07 02:18 AM
make a sentence from words chosen at random DL[_3_] Excel Programming 1 September 18th 03 11:53 AM


All times are GMT +1. The time now is 12:28 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"