AlanAnderson
Board Regular
- Joined
- Jun 7, 2010
- Messages
- 134
Hi all,
I am using Excel 2003 running on XP.
I have a routine that allows me to work on data held within a list created from data on a spreadsheet ("Income"). This works perfectly when there is data in the sheet.
If the data sheet is empty (like after month end) then I get the following error relating to the line "ListIndex=1":
"Run time error 380"
"Could not set the ListIndex property. Invalid property value."
The bit of code where this "falls over" is listed below.
I think I need some form of "if" loop to load up empty lists so that the user can add new items but don't know where to start.
Can anyone please help?
Regards,
Alan
I am using Excel 2003 running on XP.
I have a routine that allows me to work on data held within a list created from data on a spreadsheet ("Income"). This works perfectly when there is data in the sheet.
If the data sheet is empty (like after month end) then I get the following error relating to the line "ListIndex=1":
"Run time error 380"
"Could not set the ListIndex property. Invalid property value."
The bit of code where this "falls over" is listed below.
Code:
With Me.ListBox1
.BoundColumn=2
.ColumnCount=10
.ColumnHeads=True
.TextColumn=True
.RowSource="Income!B13:K" & FinalRow
.ListStyle=fmListStyleOption
.ListIndex= 1
End With
I think I need some form of "if" loop to load up empty lists so that the user can add new items but don't know where to start.
Can anyone please help?
Regards,
Alan