PC Review


Reply
Thread Tools Rate Thread

Data inside Cell Seperated by comma

 
 
gwoodby@gmail.com
Guest
Posts: n/a
 
      7th Nov 2007
Is there any Way to pull data from a cell, then store that in an
array, then split the data and set it in 2 different text boxes??
for instance the name John Monroe
MyString = John, Monroe

TextBox1.text = John
TextBox2.text = Monroe
Im not really sure how to do this, My spreadsheet is already fairly
large, so im trying to hide multiple items inside a s ingle cell now,
MyString will be selected from a combobox, if that helps any :|

 
Reply With Quote
 
 
 
 
Sun Tzu
Guest
Posts: n/a
 
      7th Nov 2007
On Nov 7, 8:13 am, gwoo...@gmail.com wrote:
> Is there any Way to pull data from a cell, then store that in an
> array, then split the data and set it in 2 different text boxes??
> for instance the name John Monroe
> MyString = John, Monroe
>
> TextBox1.text = John
> TextBox2.text = Monroe
> Im not really sure how to do this, My spreadsheet is already fairly
> large, so im trying to hide multiple items inside a s ingle cell now,
> MyString will be selected from a combobox, if that helps any :|


Versions of Excel after 97 have the "Split" function that should help.

Dim strA as String
Dim strB as String
Dim strC as String
Dim strX as String
Dim vntX as Variant
strX = "a,b,c"
vntX = Split(strX, ",")
strA = vntX(0) ' "a"
strB = vntX(1) ' "b"
strC = vntX(2) ' "c"

 
Reply With Quote
 
=?Utf-8?B?RG9tVGhlUG9t?=
Guest
Posts: n/a
 
      7th Nov 2007
if you are sure that your values will be seperated by a comma then use the
instr function:

TextBox1.text = left(cbo.value,instr(1, cbo.value,",")-1) 'pulls all text
to the left of the comma

TextBox2.text = right(cbo.value,trim(len(cbo.value) - instr(1,
cbo.value,","))) 'pulls all text to the right of the comma

"(E-Mail Removed)" wrote:

> Is there any Way to pull data from a cell, then store that in an
> array, then split the data and set it in 2 different text boxes??
> for instance the name John Monroe
> MyString = John, Monroe
>
> TextBox1.text = John
> TextBox2.text = Monroe
> Im not really sure how to do this, My spreadsheet is already fairly
> large, so im trying to hide multiple items inside a s ingle cell now,
> MyString will be selected from a combobox, if that helps any :|
>
>

 
Reply With Quote
 
gwoodby@gmail.com
Guest
Posts: n/a
 
      7th Nov 2007
On Nov 7, 8:42 am, Sun Tzu <suntzuc...@aol.com> wrote:
> On Nov 7, 8:13 am, gwoo...@gmail.com wrote:
>
> > Is there any Way to pull data from a cell, then store that in an
> > array, then split the data and set it in 2 different text boxes??
> > for instance the name John Monroe
> > MyString = John, Monroe

>
> > TextBox1.text = John
> > TextBox2.text = Monroe
> > Im not really sure how to do this, My spreadsheet is already fairly
> > large, so im trying to hide multiple items inside a s ingle cell now,
> > MyString will be selected from a combobox, if that helps any :|

>
> Versions of Excel after 97 have the "Split" function that should help.
>
> Dim strA as String
> Dim strB as String
> Dim strC as String
> Dim strX as String
> Dim vntX as Variant
> strX = "a,b,c"
> vntX = Split(strX, ",")
> strA = vntX(0) ' "a"
> strB = vntX(1) ' "b"
> strC = vntX(2) ' "c"


Ty It works Perfectly!!! I owe you and this form, It has been an
incredible help to me, I appreciate All of you!

 
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
auto populating comma seperated data in one cell to multiple cells guyvanzyl Microsoft Excel Discussion 1 4th Jul 2006 12:18 PM
Exctracting comma seperated data from a single cell guyvanzyl Microsoft Excel Misc 3 30th Jun 2006 12:18 PM
Find the sum of Comma Seperated Values In a Cell xcelion Microsoft Excel Worksheet Functions 2 24th Aug 2005 07:55 AM
Put all cells in one cell seperated by comma kokopoko Microsoft Excel New Users 6 6th Aug 2005 03:03 AM
have 3 pieces of data in a cell seperated by a comma. How can I isolate the middle piece of data? =?Utf-8?B?ZGNi?= Microsoft Excel Misc 4 5th Nov 2003 08:38 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:32 AM.