removing selection focus in listbox

C

Craig Wilks

A listbox with multi select single is used to both add and subtract from
a total. Click on a row first time and it adds, click on the same row
again and it is removed from the total. The latter is in case an
incorrect row is selected in the first instance. However, if a row is
selected and then the operator realises it was an incorrect choice, the
same row cannot be reselected until some other row is clicked to take
the selection focus away from the first row. What line of code will
remove focus from a selected line in the list box to allow it to be
selected again immediately?

Craig Wilks

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
R

Ron de Bruin

Try this Graig

for i = 0 to listbox1.Listcount-1
listbox1.Selected(i) = False
Next
 
T

Tom Ogilvy

Where is the Listbox located? There are different events associated with a
listbox when used on a userform and when used on a worksheet. Assume a
Listbox from the control toolbox toolbar.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top