PDA

View Full Version : Solved: Disable UserForm OK icon until a selection has been made



JimS
03-10-2010, 08:00 AM
Is there a way to post a warning message if a user attempts to click the OK icon on a UserForm before they have made a selection in the ListBox?

Thanks...

JimS

Bob Phillips
03-10-2010, 08:05 AM
If Me.ListBox.ListIndex = -1 Then

MsgBox "Select something"
Else

'do something
End If

JimS
03-10-2010, 11:24 AM
Perfect - Thanks...

JimS
03-10-2010, 11:38 AM
Solved.