View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default Listbox Index Problem

Todd,

LstBxItem is an integer or long, not an object, and thus does not
have a Value property. This would be clear if you explicitly
declare your variables.

--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Todd Huttenstine" wrote in
message ...
With Worksheets("Wkly Renewals").ListBox1
For LstBxItem = 0 To .ListCount - 1
If .Selected(LstBxItem) Then
MsgBox .List(LstBxItem)
MsgBox LstBxItem.Value
end with
When it hits the line MsgBox .List(LstBxItem) it displays
the value. In this case its index item 0 so it displays
the index item 0 which is the value "Jan Week 1" When it
gets to the MsgBox LstBxItem.Value line, I get the error
Runtime error 424 object required.

Why is this?