Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
divide a string words separated by (number) | Excel Discussion (Misc queries) | |||
read database | Excel Programming | |||
Divide comma-separated string and look up corresponding category | Excel Programming | |||
Divide comma-separated string and look up corresponding category | Excel Programming | |||
Divide comma-separated string and look up corresponding category | Excel Programming |