PC Review


Reply
Thread Tools Rate Thread

how do i extract multiple data from a cell(string) whose length v.

 
 
=?Utf-8?B?R2l0cw==?=
Guest
Posts: n/a
 
      19th Sep 2007
I need to extract all numbers into different columns (delimiter is ,). e.g.
1,325,16420,5,6,120,4643,2,8,-71,-68,-6 the length of numbers within
could vary.
 
Reply With Quote
 
 
 
 
=?Utf-8?B?Sm9lbA==?=
Guest
Posts: n/a
 
      19th Sep 2007
Put you comma delimited string in cell A1. code will put numbers starting in
row 2 cell A2.

Sub splitstring()

MyString = Range("A1").Value
MyOff = 0
Do While InStr(MyString, ",") > 0
MyNum = Val(Left(MyString, InStr(MyString, ",") - 1))
MyString = Mid(MyString, InStr(MyString, ",") + 1)
Range("A2").Offset(0, MyOff).Value = MyNum
MyOff = MyOff + 1
Loop
MyNum = Val(MyString)
Range("A2").Offset(0, MyOff).Value = MyNum

End Sub


"Gits" wrote:

> I need to extract all numbers into different columns (delimiter is ,). e.g.
> 1,325,16420,5,6,120,4643,2,8,-71,-68,-6 the length of numbers within
> could vary.

 
Reply With Quote
 
=?Utf-8?B?U3RlZmk=?=
Guest
Posts: n/a
 
      20th Sep 2007
Data/Text to Columns/separated by comma

Regards,
Stefi

„Gits” ezt *rta:

> I need to extract all numbers into different columns (delimiter is ,). e.g.
> 1,325,16420,5,6,120,4643,2,8,-71,-68,-6 the length of numbers within
> could vary.

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Extract a string from a cell MrLarrier Microsoft Excel Worksheet Functions 3 13th Jan 2009 04:58 PM
Extract Cell Contents to String arm9047 Microsoft Excel Programming 3 29th Dec 2007 06:40 AM
Extract cell data from multiple files in one folder =?Utf-8?B?c21vbnNtbw==?= Microsoft Excel Misc 3 17th Aug 2007 11:16 PM
how to extract data in .txt format from the excel sheet in a fixed length ascii forma pramod_kmr Microsoft Excel Programming 1 3rd Mar 2004 11:54 AM
Extract string from cell G. I. Microsoft Excel Misc 6 31st Dec 2003 12:13 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:05 AM.