Consulting

Results 1 to 6 of 6

Thread: Solved: Make a structured list in a textbox.

  1. #1
    VBAX Regular
    Joined
    May 2006
    Posts
    33
    Location

    Solved: Make a structured list in a textbox.

    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 !

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Quote Originally Posted by WebGuy
    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?

  3. #3
    VBAX Guru
    Joined
    Mar 2005
    Posts
    3,296
    Location
    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?

  4. #4
    VBAX Master Norie's Avatar
    Joined
    Jan 2005
    Location
    Stirling, Scotland
    Posts
    1,831
    Location
    You could use something like this.
    Private Sub CommandButton1_Click()
        TextBox1.Text = TextBox1.Text & ComboBox1.Value & vbCrLf
    End Sub

  5. #5
    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
    Last edited by MountainVogu; 07-12-2006 at 03:35 PM.

  6. #6
    VBAX Regular
    Joined
    May 2006
    Posts
    33
    Location
    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 !

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •