Runtime error 6 Overflow
08.02.2004 21:40:57
abhazian_delight@yahoo.com
kann mir einer sagen wiso ich hier ein RuntimeError 6 Overflow bekomme?
Fehlemeldung kommt bei "LastInputRow = Cells....)
Wenn ich statt integer long nehme habe ich keinen Fehler aber dafür auch keine Daten in der Listbox.
Es wir aus einer Tabelle4 die Daten in ein Userform übertragen. Zwischenzeitlich ging es, doch dann kamen allerlei Fehlermeldungen. Sogar beim Aufruf der Userform.
Sub DB_Button_Click()
Load DB_UserForm....................hier kommt auch eine Fehlermeldung
DB_UserForm.Show
Unload DB_UserForm
End Sub
Danke im Vorraus
ARC
Sub DB_ListBox1_Change()
UpdateListBox Me.DB_ListBox2, Me.DB_ListBox1.ListIndex ' update the items in ListBox2
End Sub
' DB Aktualisierung
Sub UpdateListBox(lb As MSForms.ListBox, IndexValue As Integer)
Const FirstInputRow As Integer = 5
Dim LastInputRow As Integer, ColumnIndex As Long, InputRange As Range
ColumnIndex = IndexValue + 2 ' determine which column to get list items from
LastInputRow = Cells(FirstInputRow, ColumnIndex).End(xlDown).Row ' determine the last input row
Set InputRange = ActiveSheet.Range(Cells(FirstInputRow, ColumnIndex), Cells(LastInputRow, ColumnIndex))
With lb
.ColumnHeads = True ' use the row above input range as header
.RowSource = InputRange.Address ' set the input range
'.RowSource = "'" & ActiveSheet.Name & "'!" & Range(Cells(FirstInputRow, ColumnIndex), Cells(LastInputRow, ColumnIndex)).Address
'.RowSource = Range(Cells(FirstInputRow, ColumnIndex), Cells(LastInputRow, ColumnIndex)).Address
.ListIndex = 0 ' select the first item
End With
Set InputRange = Nothing
End Sub
Sub UserForm_Initialize()
With Me
UpdateListBox .DB_ListBox1, -1
End With
End Sub