StartingOut
Board Regular
- Joined
- Feb 1, 2011
- Messages
- 92
Hi, I have this code to search my "Membership Sales" worksheet. but it will not run and highlights .List(.ListCount - 1, 11) = c.Offset(0, (x + 10)).Value and returns the error "could not set the list property" it seams that if I comment that line out it simply fails on the next line as if the rows starting in the double digits are not right.
I'm just not seeing the problem.
"With Me.ListBox1
.AddItem c.Value
.List(.ListCount - 1, 0) = c.Offset(0, x).Address 'record number
.List(.ListCount - 1, 1) = c.Offset(0, x).Value 'surname
.List(.ListCount - 1, 2) = c.Offset(0, (x + 1)).Value 'first name
.List(.ListCount - 1, 3) = c.Offset(0, (x + 2)).Value 'DOB
.List(.ListCount - 1, 4) = c.Offset(0, (x + 3)).Value 'address
.List(.ListCount - 1, 5) = c.Offset(0, (x + 4)).Value 'date spoken to
.List(.ListCount - 1, 6) = c.Offset(0, (x + 5)).Value 'notes
.List(.ListCount - 1, 7) = c.Offset(0, (x + 6)).Value
.List(.ListCount - 1, 8) = c.Offset(0, (x + 7)).Value
.List(.ListCount - 1, 9) = c.Offset(0, (x + 8)).Value
.List(.ListCount - 1, 10) = c.Offset(0, (x + 9)).Value
.List(.ListCount - 1, 11) = c.Offset(0, (x + 10)).Value
.List(.ListCount - 1, 12) = c.Offset(0, (x + 11)).Value
.List(.ListCount - 1, 13) = c.Offset(0, (x + 12)).Value
.List(.ListCount - 1, 14) = c.Offset(0, (x + 13)).Value
.List(.ListCount - 1, 15) = c.Offset(0, (x + 14)).Value
.List(.ListCount - 1, 16) = c.Offset(0, (x + 15)).Value
.List(.ListCount - 1, 17) = c.Offset(0, (x + 16)).Value
.List(.ListCount - 1, 18) = c.Offset(0, (x + 17)).Value
.List(.ListCount - 1, 19) = c.Offset(0, (x + 18)).Value
.List(.ListCount - 1, 20) = c.Offset(0, (x + 19)).Value
.List(.ListCount - 1, 21) = c.Offset(0, (x + 20)).Value
End With"
I'm just not seeing the problem.
"With Me.ListBox1
.AddItem c.Value
.List(.ListCount - 1, 0) = c.Offset(0, x).Address 'record number
.List(.ListCount - 1, 1) = c.Offset(0, x).Value 'surname
.List(.ListCount - 1, 2) = c.Offset(0, (x + 1)).Value 'first name
.List(.ListCount - 1, 3) = c.Offset(0, (x + 2)).Value 'DOB
.List(.ListCount - 1, 4) = c.Offset(0, (x + 3)).Value 'address
.List(.ListCount - 1, 5) = c.Offset(0, (x + 4)).Value 'date spoken to
.List(.ListCount - 1, 6) = c.Offset(0, (x + 5)).Value 'notes
.List(.ListCount - 1, 7) = c.Offset(0, (x + 6)).Value
.List(.ListCount - 1, 8) = c.Offset(0, (x + 7)).Value
.List(.ListCount - 1, 9) = c.Offset(0, (x + 8)).Value
.List(.ListCount - 1, 10) = c.Offset(0, (x + 9)).Value
.List(.ListCount - 1, 11) = c.Offset(0, (x + 10)).Value
.List(.ListCount - 1, 12) = c.Offset(0, (x + 11)).Value
.List(.ListCount - 1, 13) = c.Offset(0, (x + 12)).Value
.List(.ListCount - 1, 14) = c.Offset(0, (x + 13)).Value
.List(.ListCount - 1, 15) = c.Offset(0, (x + 14)).Value
.List(.ListCount - 1, 16) = c.Offset(0, (x + 15)).Value
.List(.ListCount - 1, 17) = c.Offset(0, (x + 16)).Value
.List(.ListCount - 1, 18) = c.Offset(0, (x + 17)).Value
.List(.ListCount - 1, 19) = c.Offset(0, (x + 18)).Value
.List(.ListCount - 1, 20) = c.Offset(0, (x + 19)).Value
.List(.ListCount - 1, 21) = c.Offset(0, (x + 20)).Value
End With"