PDA

View Full Version : Solved: Make a structured list in a textbox.



WebGuy
07-12-2006, 05:00 AM
Hi !

I have a userform with a combobox. i want to be able to move values from the combobox to a structured list in a textbox. Ie. 1 server name per row in the textbox ..
Basically i just want to make "cells" in the textbox. Does anybody have a clue as how to do this ?
Oh .. and how would i go about reading the separate "cells" with server names from the textbox one at a time ?

I'll post a pic of how it looks ..

Thanks !

Bob Phillips
07-12-2006, 05:31 AM
Hi !

I have a userform with a combobox. i want to be able to move values from the combobox to a structured list in a textbox. Ie. 1 server name per row in the textbox ..
Basically i just want to make "cells" in the textbox. Does anybody have a clue as how to do this ?
Oh .. and how would i go about reading the separate "cells" with server names from the textbox one at a time ?

I'll post a pic of how it looks ..

Thanks !

Why not use a Listbox?

OBP
07-12-2006, 09:30 AM
Hello again Webguy.
I take it you have a long list in the Combo, which you want to select from a shorter list, which you then do something with.
Will the actions on the short list take place as soon as you have finished the selection process?
If so then you can either place the selected Server names in to a string or in to an array as they are being selected. Alternatively you can use a Listbox instead of a text box to receive the chosen Server names and then they can either be clicked on manually one at a time or the Listbox's rowsource can be stepped through one at a time.
Would yo care to post us a Worksheet to "play" with?

Norie
07-12-2006, 10:38 AM
You could use something like this.


Private Sub CommandButton1_Click()
TextBox1.Text = TextBox1.Text & ComboBox1.Value & vbCrLf
End Sub

MountainVogu
07-12-2006, 03:15 PM
Here's something I created and use alot.

I stripped out all my code for populating listbox1 and replaced it with a random letter string generated set of data and random number of rows (Ignore that code)

I create a 2 dimensional array of list entries bound 1, the text I wanna see, bound 2, the list items' position in the list.

Both listboxes have to 2 cols and bound to col 1

Transfer methods: Click and Drag, Double Click, Select and use transfer command buttons


In the example I have prepended the position on listbox1 to the entry so you can see what it does.

When you send an item back from listbox2 it will be replaced in the position it was taken from.

Anyhoo, just thought i'd share something I find rather useful, but I feel sure the coding could be much improved.

Mv

WebGuy
07-12-2006, 11:15 PM
Yes ! Thank you MountainVogu! That is exactly what i need !
I'm going to use it to select a number of servers and then display all their hardware and the latest uppdates and software patches.
I hope it works !
Thank you all for helping me !