-
Selected Item in Listbox
I found an issue with using Listbox.Selected(i) in 2010 to test for any selected items. In the end I came up with this to be compatible between 2003 & 2010
[VBA]'Check for Selected; handle 2003 and 2010 versions
If IsNull(ListBox1) And ListBox1.Selected(1) = False Then
MsgBox "No item selected", vbExclamation
Exit Sub
End If[/VBA]
MVP (Excel 2008-2010)
Post a workbook with sample data and layout if you want a quicker solution.
To help indent your macros try Smart Indent
Please remember to mark threads 'Solved'
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules