Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 67
Default split problem

Hi all,

I am interesting to break a string with spaces into an array with substrings
and to have it in the same cell.
for example:
dim MyString as string
MyString = range("A1").value ' range("A1").value = "Good morning"
range("A1").value = split(MyString, " ").

The problem is that instead of:
Good
morning

as range("A1").value I get only: morning.

Please help me to fix it!

Thanks

Eli

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default split problem

'Once you split it returns an array; so that you could try

Dim MyString As String
MyString = Range("A1").Value
Range("A1:B1") = Split(MyString, " ")

'Instead ..if you mean to replace a splace with carriage return then try
Range("A1") = Replace(Range("A1"), " ", vbLf)


--
Jacob


"אלי" wrote:

Hi all,

I am interesting to break a string with spaces into an array with substrings
and to have it in the same cell.
for example:
dim MyString as string
MyString = range("A1").value ' range("A1").value = "Good morning"
range("A1").value = split(MyString, " ").

The problem is that instead of:
Good
morning

as range("A1").value I get only: morning.

Please help me to fix it!

Thanks

Eli

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 67
Default split problem

Many thanks!

"Jacob Skaria" wrote:

'Once you split it returns an array; so that you could try

Dim MyString As String
MyString = Range("A1").Value
Range("A1:B1") = Split(MyString, " ")

'Instead ..if you mean to replace a splace with carriage return then try
Range("A1") = Replace(Range("A1"), " ", vbLf)


--
Jacob


"אלי" wrote:

Hi all,

I am interesting to break a string with spaces into an array with substrings
and to have it in the same cell.
for example:
dim MyString as string
MyString = range("A1").value ' range("A1").value = "Good morning"
range("A1").value = split(MyString, " ").

The problem is that instead of:
Good
morning

as range("A1").value I get only: morning.

Please help me to fix it!

Thanks

Eli

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
Data Split and sort problem joecrabtree Excel Programming 1 December 20th 06 03:33 PM
Data Split and graph problem joecrabtree Excel Programming 8 December 13th 06 06:25 PM
Split cell info via VB problem BEEJAY Excel Programming 3 September 20th 06 01:16 PM
Formula Split or parenthesis problem? nastech Excel Discussion (Misc queries) 0 January 16th 06 12:59 AM
Excel split window refresh problem david Excel Programming 5 September 9th 05 02:20 PM


All times are GMT +1. The time now is 08:27 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"