Hi guys
I am having a couple of problems with a listbox when there are no rows in it.
I have an original sheet "OpenIssues" containing all of the data. There are then three optional comboboxes which filter the original data down dynamically to a sheet "FilteredIssues". The dynamic ranges work fine when there are rows to show in the listbox, but when there are no rows to show I get either a 1004 error or a 380 error in a couple of places in the code
Error 380 occurs in the following code snippet
If CurrentRecordID > 1 Then
ReportListBox.ListIndex = CurrentRecordID - 2
Else
ReportListBox.ListIndex = 1
End If
CurrentRecordID = 1 biut the error occurs at ReportListBox.ListIndex = 1
Error 1004 occurs in the following code snippet
Private Sub FillListBox()
Call SelectFirstBlankCell
Dim r As Integer
r = ReportListBox.ListIndex ' + 1
If r < 0 Then r = 1
Range("FilterOpenIssues").Select
....more code
EndSub
Is there a way to trap the listbox when there are no rows to be displayed
Thanks
Ernie
I am having a couple of problems with a listbox when there are no rows in it.
I have an original sheet "OpenIssues" containing all of the data. There are then three optional comboboxes which filter the original data down dynamically to a sheet "FilteredIssues". The dynamic ranges work fine when there are rows to show in the listbox, but when there are no rows to show I get either a 1004 error or a 380 error in a couple of places in the code
Error 380 occurs in the following code snippet
If CurrentRecordID > 1 Then
ReportListBox.ListIndex = CurrentRecordID - 2
Else
ReportListBox.ListIndex = 1
End If
CurrentRecordID = 1 biut the error occurs at ReportListBox.ListIndex = 1
Error 1004 occurs in the following code snippet
Private Sub FillListBox()
Call SelectFirstBlankCell
Dim r As Integer
r = ReportListBox.ListIndex ' + 1
If r < 0 Then r = 1
Range("FilterOpenIssues").Select
....more code
EndSub
Is there a way to trap the listbox when there are no rows to be displayed
Thanks
Ernie