Results 1 to 5 of 5

Thread: value to textbox

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2005
    Posts
    13

    value to textbox

    Hi

    I get values from an ini file wich i read in to an array. How do I get the values to right textbox? I use VBA. It's about 50 values...


    Kaaja

  2. #2
    PowerPoster kfcSmitty's Avatar
    Join Date
    May 2005
    Posts
    2,248

    Re: value to textbox

    VB Code:
    1. Dim I as integer
    2.  
    3. for i = 1 to ubound(array)
    4. textbox1.text = textbox1.text & " " & array(i)
    5. next

    will place easch item in the array into a textbox, with a space inbetween each.

    If you want a blank line intead of a space, replace " " with vbCrLf

  3. #3

    Thread Starter
    New Member
    Join Date
    Jun 2005
    Posts
    13

    Re: value to textbox

    Thats not what I'm looking for. I want the text in seperate textboxes. Each line into a specific textbox. But the line can be located where ever inte the array.

  4. #4
    PowerPoster kfcSmitty's Avatar
    Join Date
    May 2005
    Posts
    2,248

    Re: value to textbox

    how are you deciding which textbox each line goes into? How many textboxes do you have?

  5. #5
    Member
    Join Date
    Jun 2005
    Posts
    41

    Re: value to textbox

    If I understand you correctly, its the same as above, but with just a slight difference.

    VB Code:
    1. Dim ii as Integer
    2. for ii = 1 to ubound(array)
    3. Range("A1").Select 'or whichever cell to start
    4. ActiveCell.Offset(ii-1,0).Select
    5. 'Offset(row, column) so you can decide the direction
    6. 'the cells are read into... horizontal or vertical (which I have it set to)
    7. ActiveCell.Value = array(ii)
    8. next ii

    Hope this is what you're looking for.

Posting Permissions

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



Click Here to Expand Forum to Full Width