I have a userform ("Userform1") and I am trying to add two items to a listbox.
When the code runs the line
.AddItem = "Acquisition Budget"
I get an error "Compile error: Expected Function or variable". Code below. Any ideas?
Private Sub UserForm_Initialize()
Dim MySheet As String
TextBox3.Value = 0
TextBox4.Value = 0
MySheet = "Data Validation"
ListBox1.RowSource = "'" & Sheets(MySheet).Name & "'!" & Sheets(MySheet).Range("Building[Building]").Address
With UserForm1.ListBox2
.AddItem = "Acquisition Budget"
.AddItem = "Original Budget"
End With
End Sub
Bookmarks