Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default removing selection focus in listbox

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!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default removing selection focus in listbox

Try this Graig

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



--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Craig Wilks" wrote in message ...
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!



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default removing selection focus in listbox

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.

--
Regards,
Tom Ogilvy



Craig Wilks wrote in message
...
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!



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to show cell selection when excel not in focus + other questio Jim E Setting up and Configuration of Excel 1 September 27th 09 08:20 PM
Listbox selection ub Excel Discussion (Misc queries) 0 March 10th 09 06:43 PM
Removing a listbox from excel spreadsheet TrishB98 Excel Worksheet Functions 3 July 16th 08 07:57 PM
Listbox & Selection sparx Excel Discussion (Misc queries) 0 July 31st 06 10:48 PM
Simulating the Format Painter, Selection.Select, and taking focus David McRitchie[_2_] Excel Programming 3 July 10th 03 03:48 AM


All times are GMT +1. The time now is 12:29 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"