Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 58
Default Data inside Cell Seperated by comma

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 :|

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Data inside Cell Seperated by comma

On Nov 7, 8:13 am, 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"

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 54
Default Data inside Cell Seperated by comma

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

" 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 :|


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 58
Default Data inside Cell Seperated by comma

On Nov 7, 8:42 am, Sun Tzu wrote:
On Nov 7, 8:13 am, 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
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
Extracting comma seperated data to new sheet Rmcnaught[_2_] Excel Programming 0 July 17th 06 09:18 PM
Exctracting comma seperated data from a single cell guyvanzyl Excel Discussion (Misc queries) 3 June 30th 06 12:18 PM
Find the sum of Comma Seperated Values In a Cell xcelion Excel Worksheet Functions 3 August 24th 05 07:55 AM
Sum of comma seperated values in cell(Reposting) xcelion Excel Worksheet Functions 3 August 22nd 05 01:16 PM
Put all cells in one cell seperated by comma kokopoko New Users to Excel 6 August 6th 05 03:03 AM


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