Results 1 to 4 of 4
  1. #1
    3 Star Lounger MacroAlan's Avatar
    Join Date
    Feb 2003
    Location
    St Louis, Missouri, USA
    Posts
    254
    Thanks
    6
    Thanked 1 Time in 1 Post

    Fill Array from Text Box (VBA/Excel/2000)

    I have this idea that my user will key a bunch of numbers into a text box that will be used to fill an array.

    In my first try, the array filed the whole thing as one string. Attached is a picture of the dialog box. If anyone has a better suggestion, I am all ears. <img src=/S/igiveup.gif border=0 alt=igiveup width=31 height=23>

    The number of stores could be anywhere from 10 to 100.
    Alan

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Fill Array from Text Box (VBA/Excel/2000)

    How did you create the array? I would be inclined to use the Split() method, myself.

  3. #3
    3 Star Lounger MacroAlan's Avatar
    Join Date
    Feb 2003
    Location
    St Louis, Missouri, USA
    Posts
    254
    Thanks
    6
    Thanked 1 Time in 1 Post

    Re: Fill Array from Text Box (VBA/Excel/2000)

    I had never heard of SPLIT(). It is working great.

    <pre>StoresArray = Split(usrQuestions.txtStoresCluster.Text, , -1)
    For F = 1 To UBound(StoresArray)
    Debug.Print StoresArray(F) <font color=red>'This will be replaced by the code to use the array</font color=red>
    Next F</pre>


    This group is a life-saver!
    Alan

  4. #4
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Fill Array from Text Box (VBA/Excel/2000)

    > I had never heard of SPLIT()

    Maybe 'cause... Split() was added with VB6, first available in Office 2000; it wasn't available in Office 97, which still used VB5.x.

    It is one of my favorite things. <img src=/S/grin.gif border=0 alt=grin width=15 height=15>

Posting Permissions

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