listbox

  • Thread starter Thread starter sal
  • Start date Start date
S

sal

Hi a have list box with this code in it.
Private Sub ListBox1_Click()
ActiveCell.Value = ListBox1.Value
strStartDir = ThisWorkbook.Path
GraphicFile = strStartDir & "\150\" & ActiveCell.Value & "a.jpg"
Image1.Picture = LoadPicture(GraphicFile)

ActiveCell.Value = ListBox1.Value
strStartDir = ThisWorkbook.Path
GraphicFile = strStartDir & "\150\" & ActiveCell.Value & "b.jpg"
Image2.Picture = LoadPicture(GraphicFile)
End Sub

everything works fine except when in the list box, if two items get
clicked on or highlighted at the same time by accident then I get a
runtime error 53. How can I force only one item to be selected. I have
multiselect set to single from the list box options.
 
Back
Top