View Single Post
  #19   Report Post  
Posted to microsoft.public.excel.programming
Anthony[_15_] Anthony[_15_] is offline
external usenet poster
 
Posts: 18
Default Resetting ListBox1.ListIndex to -1 after user selection

Just move code into the userform activate. I have sen tyou workbook

Regards


Anthony
"Hans" wrote in message
...
On Aug 22, 7:04 pm, "Anthony" wrote:
Private Sub CommandButton1_Click()

Me.ListBox1.ListIndex = -1

End Sub

I have sent you a workbook.

This is code attached to a button on the userform.

Regards

Anthony

"Hans" wrote in message

...
On Aug 22, 6:48 pm, "Anthony" wrote:



Is the listbox on the worksheet or is it on a user form?


If on a work sheet, set the input cell reference and all you would do
then
is clear the reference.


e.g A1 = input cell


User selects an itemfrom list


A1= the selected line number


To clear selected line clear A1


Regards


Anthony


Thanks Anthony,

No, the listbox is on a userform.


Hello Anthony,

You are right. That works if you put it in the code of a command
button on the userform. It is a solution but not really as it should
work I believe. :-)