Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default read string from database and divide result into cells?

I would like to read a string based on a db query (like select Names
from NameTable where Name Like '%James%') and take each resulting
string and devide then into different cells...

E.g. James Hansson - A1=James and B1=Hansson

How can this be done? I can get as far as using querytables and show
the results in the current sheet but thats not what I want.

//Ladyhawke

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default read string from database and divide result into cells?

if James Hansson is in A1, then
=LEFT(A1,FIND(" ",A1)-1) will give you James and
=RIGHT(A1,LEN(A1)-FIND(" ",A1)) will give you Hansson

or you could use the Text to Columns feature.

--
Gary's Student


"ladyhawke" wrote:

I would like to read a string based on a db query (like select Names
from NameTable where Name Like '%James%') and take each resulting
string and devide then into different cells...

E.g. James Hansson - A1=James and B1=Hansson

How can this be done? I can get as far as using querytables and show
the results in the current sheet but thats not what I want.

//Ladyhawke


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default read string from database and divide result into cells?

Ok, that will work if my string is in a cell...

I would like i VBA to fetch a string result from Database and split the
string before showing the data in cells...

Do you know how?

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,651
Default read string from database and divide result into cells?

On 29 Jun 2006 02:36:09 -0700, "ladyhawke" wrote:

Ok, that will work if my string is in a cell...

I would like i VBA to fetch a string result from Database and split the
string before showing the data in cells...

Do you know how?


Use the SPLIT function in VBA


--ron
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default read string from database and divide result into cells?

Had the same idea but I'm a newbie here and I don't even know how to
fetch the string directly from the VBA code instead of my current
roundtrip to a cell....


Ron Rosenfeld skrev:

On 29 Jun 2006 02:36:09 -0700, "ladyhawke" wrote:

Ok, that will work if my string is in a cell...

I would like i VBA to fetch a string result from Database and split the
string before showing the data in cells...

Do you know how?


Use the SPLIT function in VBA


--ron




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,651
Default read string from database and divide result into cells?

On 30 Jun 2006 03:18:59 -0700, "ladyhawke" wrote:

Had the same idea but I'm a newbie here and I don't even know how to
fetch the string directly from the VBA code instead of my current
roundtrip to a cell....


Ron Rosenfeld skrev:

On 29 Jun 2006 02:36:09 -0700, "ladyhawke" wrote:

Ok, that will work if my string is in a cell...

I would like i VBA to fetch a string result from Database and split the
string before showing the data in cells...

Do you know how?


Use the SPLIT function in VBA


--ron


It's hard to advise as you give little information about what you are doing
now. How are you getting it into the cell now?


--ron
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
divide a string words separated by (number) ferde Excel Discussion (Misc queries) 3 June 4th 10 01:33 AM
read database William[_8_] Excel Programming 2 April 25th 06 06:08 PM
Divide comma-separated string and look up corresponding category kmb1[_3_] Excel Programming 0 November 3rd 04 07:38 PM
Divide comma-separated string and look up corresponding category kmb1[_2_] Excel Programming 0 November 3rd 04 07:37 PM
Divide comma-separated string and look up corresponding category kmb1 Excel Programming 1 October 26th 04 07:07 PM


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"