Results 1 to 3 of 3
  1. #1
    4 Star Lounger
    Join Date
    May 2004
    Location
    Toronto, Ontario, Canada
    Posts
    425
    Thanks
    5
    Thanked 0 Times in 0 Posts

    ASCII Combobox (Excel 2000)

    Hi all,

    I have a Combobox, in a form that I would like to display the Characters of the Keyboard in the combobox, so that when it is displayed it fills the box with the Ascii Character. My issue with this is that I can't get it to work, and I am still not that good at making Counters,

    Public Sub ABC()
    Dim II As Integer
    Dim asc As Integer
    For II = Asc(0) To Ubound Asc(127)
    UserForm1.ListBox2.AddItem II
    Next II
    UserForm1.Show
    End Sub



    Thanks, Darryl.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: ASCII Combobox (Excel 2000)

    You don't need Asc as a variable, and the line

    For II = Asc(0) To Ubound Asc(127)

    doesn't make sense. A working version is

    Public Sub ABC()
    Dim II As Integer
    For II = 0 To 127
    UserForm1.ListBox1.AddItem Chr(II)
    Next II
    UserForm1.Show
    End Sub

    but you may want to let the loop counter II run from 32 instead of from 0, since the characters with code 0 through 31 are non-printing characters.

  3. #3
    4 Star Lounger
    Join Date
    May 2004
    Location
    Toronto, Ontario, Canada
    Posts
    425
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Re: ASCII Combobox (Excel 2000)

    Thank you Hans

Posting Permissions

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