Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Im pulling some data from an acces database that looks like this:
Tax-82.54 Disc-0 Online-206.50 Instant-503.00€¡CC-146€¡€¡Visa-139.14€¡MC-€¡Debit-187.26€¡€¡PM-3.00€¡RJR-€¡Lor-€¡S&M-€¡USST-7.00€¡Other-€¡Total Coupons-10.00€¡Safe Fund- 300.00 How can I get it to look like this: Tax-82.54 Disc-0 Online-206.50 Instant-503.00 CC-146 Visa-139.14 MC- Debit-187.26 PM-3.00 RJR- Lor- S&M- USST-7.00 Other- Total Coupons-10.00 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Where is the information you are pulling in located at... In a variable? In
3 variables (one per line)? A cell on a worksheet? Three cells (one per line) on a worksheet? The Textbox itself? An array variable? Some place else? Where do you want the split apart text to be placed... the TextBox? -- Rick (MVP - Excel) "Mike" wrote in message ... Im pulling some data from an acces database that looks like this: Tax-82.54 Disc-0 Online-206.50 Instant-503.00€¡CC-146€¡€¡Visa-139.14€¡MC-€¡Debit-187.26€¡€¡PM-3.00€¡RJR-€¡Lor-€¡S&M-€¡USST-7.00€¡Other-€¡Total Coupons-10.00€¡Safe Fund- 300.00 How can I get it to look like this: Tax-82.54 Disc-0 Online-206.50 Instant-503.00 CC-146 Visa-139.14 MC- Debit-187.26 PM-3.00 RJR- Lor- S&M- USST-7.00 Other- Total Coupons-10.00 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Rick,
The information is located in a field of an access database. Im using ADODB/SQL query to get the data out of the database. I would like to put it into the Textbox. "Rick Rothstein" wrote: Where is the information you are pulling in located at... In a variable? In 3 variables (one per line)? A cell on a worksheet? Three cells (one per line) on a worksheet? The Textbox itself? An array variable? Some place else? Where do you want the split apart text to be placed... the TextBox? -- Rick (MVP - Excel) "Mike" wrote in message ... Im pulling some data from an acces database that looks like this: Tax-82.54 Disc-0 Online-206.50 Instant-503.00€¡CC-146€¡€¡Visa-139.14€¡MC-€¡Debit-187.26€¡€¡PM-3.00€¡RJR-€¡Lor-€¡S&M-€¡USST-7.00€¡Other-€¡Total Coupons-10.00€¡Safe Fund- 300.00 How can I get it to look like this: Tax-82.54 Disc-0 Online-206.50 Instant-503.00 CC-146 Visa-139.14 MC- Debit-187.26 PM-3.00 RJR- Lor- S&M- USST-7.00 Other- Total Coupons-10.00 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I don't do databases, so I can't address that part at all. When you query
the database, the result of that query goes somewhere... my question is where? We can pull the text apart relatively easily, but I need to know where the text is at (that is, where can VB see it at) so I can manipulate it? Do you put the result of the query in a variable, array, worksheet, the TextBox, somewhere else? -- Rick (MVP - Excel) "Mike" wrote in message ... Rick, The information is located in a field of an access database. Im using ADODB/SQL query to get the data out of the database. I would like to put it into the Textbox. "Rick Rothstein" wrote: Where is the information you are pulling in located at... In a variable? In 3 variables (one per line)? A cell on a worksheet? Three cells (one per line) on a worksheet? The Textbox itself? An array variable? Some place else? Where do you want the split apart text to be placed... the TextBox? -- Rick (MVP - Excel) "Mike" wrote in message ... Im pulling some data from an acces database that looks like this: Tax-82.54 Disc-0 Online-206.50 Instant-503.00€¡CC-146€¡€¡Visa-139.14€¡MC-€¡Debit-187.26€¡€¡PM-3.00€¡RJR-€¡Lor-€¡S&M-€¡USST-7.00€¡Other-€¡Total Coupons-10.00€¡Safe Fund- 300.00 How can I get it to look like this: Tax-82.54 Disc-0 Online-206.50 Instant-503.00 CC-146 Visa-139.14 MC- Debit-187.26 PM-3.00 RJR- Lor- S&M- USST-7.00 Other- Total Coupons-10.00 |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Rick,
I can put results it into the textbox then manipulate it from there or how ever you think would be eaisier. Variable maybe ?? Im not sure. "Rick Rothstein" wrote: I don't do databases, so I can't address that part at all. When you query the database, the result of that query goes somewhere... my question is where? We can pull the text apart relatively easily, but I need to know where the text is at (that is, where can VB see it at) so I can manipulate it? Do you put the result of the query in a variable, array, worksheet, the TextBox, somewhere else? -- Rick (MVP - Excel) "Mike" wrote in message ... Rick, The information is located in a field of an access database. Im using ADODB/SQL query to get the data out of the database. I would like to put it into the Textbox. "Rick Rothstein" wrote: Where is the information you are pulling in located at... In a variable? In 3 variables (one per line)? A cell on a worksheet? Three cells (one per line) on a worksheet? The Textbox itself? An array variable? Some place else? Where do you want the split apart text to be placed... the TextBox? -- Rick (MVP - Excel) "Mike" wrote in message ... Im pulling some data from an acces database that looks like this: Tax-82.54 Disc-0 Online-206.50 Instant-503.00€¡CC-146€¡€¡Visa-139.14€¡MC-€¡Debit-187.26€¡€¡PM-3.00€¡RJR-€¡Lor-€¡S&M-€¡USST-7.00€¡Other-€¡Total Coupons-10.00€¡Safe Fund- 300.00 How can I get it to look like this: Tax-82.54 Disc-0 Online-206.50 Instant-503.00 CC-146 Visa-139.14 MC- Debit-187.26 PM-3.00 RJR- Lor- S&M- USST-7.00 Other- Total Coupons-10.00 |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Assuming your query text is in the TextBox (if not, substitute your
variable's name for the TextBox1.Text in the first assignment statement to the Txt variable), here is the code that will do what you asked... Dim Txt As String Dim Delimiter As String Delimiter = Chr(135) Txt = Replace(Replace(TextBox1.Text, vbCr, " "), vbLf, " ") Txt = Application.WorksheetFunction.Trim(Txt) Txt = Replace(Txt, Delimiter & Delimiter, vbLf & vbLf) Txt = Replace(Txt, Delimiter, vbLf) Txt = Left(Txt, InStrRev(Txt, vbLf) - 1) TextBox1.Text = Txt You can execute it by whatever means you want (perhaps a CommandButton Click event). -- Rick (MVP - Excel) "Mike" wrote in message ... Rick, I can put results it into the textbox then manipulate it from there or how ever you think would be eaisier. Variable maybe ?? Im not sure. "Rick Rothstein" wrote: I don't do databases, so I can't address that part at all. When you query the database, the result of that query goes somewhere... my question is where? We can pull the text apart relatively easily, but I need to know where the text is at (that is, where can VB see it at) so I can manipulate it? Do you put the result of the query in a variable, array, worksheet, the TextBox, somewhere else? -- Rick (MVP - Excel) "Mike" wrote in message ... Rick, The information is located in a field of an access database. Im using ADODB/SQL query to get the data out of the database. I would like to put it into the Textbox. "Rick Rothstein" wrote: Where is the information you are pulling in located at... In a variable? In 3 variables (one per line)? A cell on a worksheet? Three cells (one per line) on a worksheet? The Textbox itself? An array variable? Some place else? Where do you want the split apart text to be placed... the TextBox? -- Rick (MVP - Excel) "Mike" wrote in message ... Im pulling some data from an acces database that looks like this: Tax-82.54 Disc-0 Online-206.50 Instant-503.00€¡CC-146€¡€¡Visa-139.14€¡MC-€¡Debit-187.26€¡€¡PM-3.00€¡RJR-€¡Lor-€¡S&M-€¡USST-7.00€¡Other-€¡Total Coupons-10.00€¡Safe Fund- 300.00 How can I get it to look like this: Tax-82.54 Disc-0 Online-206.50 Instant-503.00 CC-146 Visa-139.14 MC- Debit-187.26 PM-3.00 RJR- Lor- S&M- USST-7.00 Other- Total Coupons-10.00 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Multiselect Listbox use | Excel Discussion (Misc queries) | |||
Multiselect List Box | Excel Programming | |||
Bug in multiselect listbox? | Excel Programming | |||
List Box - MultiSelect | Excel Programming | |||
multiselect listbox | Excel Programming |