Userform Initialize & combo box values

M

michaelberrier

I have the following code for populating a combobox with numbers 1-10.
Is there a way to change it to display letters instead of numbers?

Private Sub UserForm_Initialize()
Dim iCtr As Long
For iCtr = 1 To 10
Me.ComboBox1.AddItem iCtr
Next iCtr
End Sub

Thanks to all.
 
B

baxybaxy

isn't there a char() function in vba?

can you add 64 to ictr and set the value to char(ictr)?
 
C

Chip Pearson

There is the Chr function that returns a string based on the
ASCII value passed in. E.g.,

Debug.Print Chr(48)


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"baxybaxy"
message
news:[email protected]...
 
M

michaelberrier

I've tried adding this several places, but I get a "permission denied"
error. Where would I put this?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top