- Home
·
- Miscellaneous
·
- Entering Prefixvalues (Letters & Numbers)in a ListBox (Fast way)
Entering Prefixvalues (Letters & Numbers)in a ListBox (Fast way)
Entering Prefixvalues (Letters & Numbers)in a ListBox (Fast way)
API Declarations
Dim x As Long
Controls :
ListBox Name : List1
Command Name : Command1 Caption : Add to list
Rate Entering Prefixvalues (Letters & Numbers)in a ListBox (Fast way)
(1(1 Vote))
'See also Vbcodes of me on Snippets ; Page 607 & 609
'This code adds zero values with the alphabet letters (a to z) to a Listbox
Private Sub Command1_Click()
For i = 0 To 0 'returns Zero values
For x = 65 To 90 'returns characters a to z
List1.AddItem Chr(x) & (i)
Next x
Next i
End Sub
'Please experiment with this code (many variations are possible in a fast way)
'Changing code Possibilities :
'Note 1. How to change (prefix)numbers:
For i = 0 To 0 'returns "Zero" values
For i = 1 To 1 'returns "One" values
For i = 2 To 2 'returns "Two" values
'Note 2 . Use Copy and Paste to make(add)different positions :
'Copy : Chr(x) or (i) and place an Ampersand (&) between them .
'example 1. change code line to: List1.AddItem Chr(x) & (i)& Chr(x)& Chr(x)
'example 2. change code line to : List1.AddItem (i)& Chr(x) & (i)& Chr(x)
Good Luck
Patrick
Entering Prefixvalues (Letters & Numbers)in a ListBox (Fast way) Comments
No comments yet — be the first to post one!
Post a Comment