Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
J@Y J@Y is offline
external usenet poster
 
Posts: 127
Default Fastest way to store each word in a cell in a diff variable

If I have a cell with words in them separated by spaces, what is the
fastest/easiest way to store each word into a variable? (Non Text-to-Column
way)
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default Fastest way to store each word in a cell in a diff variable

Try something like this:

Sub test()

Dim i As Long
Dim str As String
Dim arr

str = Cells(1).Text

arr = Split(str, " ")

For i = 0 To UBound(arr)
Cells(i + 1, 2) = arr(i)
Next i

End Sub


RBS


"J@Y" wrote in message
...
If I have a cell with words in them separated by spaces, what is the
fastest/easiest way to store each word into a variable? (Non
Text-to-Column
way)


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
Macro to find a word and copy all rows with this word to diff ws Chas Excel Programming 3 April 27th 07 11:16 PM
Store the format of a cell in a variable Dave Excel Programming 2 April 26th 07 11:39 PM
Way to store cell location to variable? farful[_3_] Excel Programming 2 July 12th 06 11:44 PM
Store cell data in a variable snowing[_2_] Excel Programming 1 May 28th 06 07:04 PM
store variable keen learner Excel Programming 9 March 8th 06 02:26 PM


All times are GMT +1. The time now is 12:54 PM.

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"