hope you can help me out here, because I really can't see the error.
I'm trying to create a Userform with a listbox, where the user can choose values from an array. The code for the array is below:
Dim arrayData As Range
Dim sh As Worksheet
Dim Row_Count As Integer
Dim i As Integer
Dim lastRow2 As Long
Set sh = ThisWorkbook.Sheets("Import")
lastRow2 = sh.Columns(45).Find("*", , , , xlByRows, xlPrevious).Row
Set arrayData = sh.Range("AS2:AS" & lastRow2)
arArray = sh.Range("AS2:AS" & lastRow2)
Row_Count = arrayData.Rows.Count
For i = 1 To Row_Count
arArray(i, 45) = Cells(i, 45).Value
Next i
This works perfectly. Now I'm initializing the Userform:
Public Sub UserForm_Initialize()
Auswertung.Lst_Tabellen.List.Clear
Auswertung.Lst_Tabellen.List = arArray
End Sub
But everytime I'm trying to call the userform "Auswertung", I get the error "Runtime Error 424: Object Required". Can you guys see the issue?
Public Sub Call_Userform()
Auswertung.Show
End Sub
The Debugger marks the line "Auswertung.Show", when I run the code.