ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   capturing the values from a combo box into an xml file (https://www.excelbanter.com/excel-programming/415712-capturing-values-combo-box-into-xml-file.html)

DowningDevelopments

capturing the values from a combo box into an xml file
 
iv got a simple multi select combo box which takes the values from a range of
cells (its a concept design im trying to show that this works).

That part works, what i need to do is capture those values and then put them
into an xml file which we can ADO into a database.

im stuck on actually grabbing the values from the comboBox, how do i access
the array its storing them in, i can write a while look and go through it but
i dont know how to access the data.

any help?

Amit

[email protected]

capturing the values from a combo box into an xml file
 
On Aug 15, 7:16*am, DowningDevelopments
wrote:
iv got a simple multi select combo box which takes the values from a range of
cells (its a concept design im trying to show that this works).

That part works, what i need to do is capture those values and then put them
into an xml file which we can ADO into a database.

im stuck on actually grabbing the values from the comboBox, how do i access
the array its storing them in, i can write a while look and go through it but
i dont know how to access the data.

any help?

Amit


I assume you mean Listbox rather than combo box (as far as I know you
can't have a multiselect combo box in vba)

Is the control on a form or a worksheet, if its on a form you would
use something like the following attached to a command button so once
the user has finished selecting you can add to the xml sheet:

For i = 0 To Me.ListBox1.ListCount - 1 ' listboxes are zero based
If Me.ListBox1.Selected(i) Then ' if the item is selected then
tmpStr = tmpStr & vbCr & Me.ListBox1.List(i, 0)
End If
Next i
MsgBox tmpStr

James


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com