ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VB ListBox (https://www.excelbanter.com/excel-programming/356515-re-vbulletin-listbox.html)

Edwin Tam[_7_]

VB ListBox
 
In your userform (double-click the form), paste the following code to
"UserForm_Activate". Assume that your listbox is called "ListBox1".

Private Sub UserForm_Activate()
Dim tmp As Integer
With ListBox1
.Clear
For tmp = 1 To 12
.AddItem Format(DateSerial(2006, tmp, 1), "mmmm")
Next
End With
End Sub

Regards,
Edwin Tam

http://www.vonixx.com


"joakl" wrote:

I've never used user forms as part of a macro. I am trying to create a list
box in a user form but can't figure how to enter the list of months. I have
created the user form and inserted the list box, just can't type the months
in...any answers?

Thanks in advance



All times are GMT +1. The time now is 05:33 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com