Results 1 to 3 of 3

Thread: List Box Numbers

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2000
    Posts
    1
    I want to have a list box which lists numbers from 0 to 10 with one decimal place. Is it possible to get this in a list box without typing them all in?

  2. #2
    Hyperactive Member
    Join Date
    Nov 1999
    Location
    Galway, Ireland
    Posts
    316


    for i = 1 to 10
    list1.additem format(i,"99.9")
    next i

    Try this

    [email protected]
    Co Galway
    Ireland
    Slan

  3. #3
    Lively Member
    Join Date
    Jan 2000
    Location
    Springfield, IL
    Posts
    124
    This code will fill the listbox with the values 0.0, 0.1, 0.2, 0.3, ... , 9.8, 9.9, 10.0

    If this is what your loking for. If you only want integers then the code from john_murphy will work.

    Code:
        Dim dblNum As Double
    
        List1.Clear
        dblNum = 0
        Do While dblNum <= 10
            List1.AddItem Format(dblNum, "#0.0")
            dblNum = dblNum + 0.1
        Loop

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