ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Listbox selection (https://www.excelbanter.com/excel-programming/368340-listbox-selection.html)

Jonathan

Listbox selection
 
Hi, I have a listbox on a worksheet. When a user selects an item in the
listbox I perform an bunch of routines that updates the worksheet based on
the selection.

The problem is that the selected item only appears highlighted when I change
to another worksheet and then return. Switching worksheets has to be a manual
process for this to work; plus I want all the other worksheets hidden.

I have checked and the process does not repeat. I have tried a work-around
by storing the listbox.listindex before running any routine and then setting
the listbox.listindex to the stored value. I have tried using
application.screenupdating=true. No joy with any of these.

So any ideas why I need to use a manual move away and then return to
worksheet to see a highlighted selected item in the list? Any ideas to
resolve this so that users are not confused about their selection?

Many thanks,
Jonathan


Bob Phillips

Listbox selection
 
I can't say that I have experienced it, but you could try this in your
routines

activecell.Activate

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Jonathan" wrote in message
...
Hi, I have a listbox on a worksheet. When a user selects an item in the
listbox I perform an bunch of routines that updates the worksheet based on
the selection.

The problem is that the selected item only appears highlighted when I

change
to another worksheet and then return. Switching worksheets has to be a

manual
process for this to work; plus I want all the other worksheets hidden.

I have checked and the process does not repeat. I have tried a work-around
by storing the listbox.listindex before running any routine and then

setting
the listbox.listindex to the stored value. I have tried using
application.screenupdating=true. No joy with any of these.

So any ideas why I need to use a manual move away and then return to
worksheet to see a highlighted selected item in the list? Any ideas to
resolve this so that users are not confused about their selection?

Many thanks,
Jonathan




Jonathan

Listbox selection
 
Thanks Bob. I have just given your suggestion a go. I still have to switch
worksheets and return for the item to appear highlighted.

Many thanks
Jonathan


"Bob Phillips" wrote:

I can't say that I have experienced it, but you could try this in your
routines

activecell.Activate

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Jonathan" wrote in message
...
Hi, I have a listbox on a worksheet. When a user selects an item in the
listbox I perform an bunch of routines that updates the worksheet based on
the selection.

The problem is that the selected item only appears highlighted when I

change
to another worksheet and then return. Switching worksheets has to be a

manual
process for this to work; plus I want all the other worksheets hidden.

I have checked and the process does not repeat. I have tried a work-around
by storing the listbox.listindex before running any routine and then

setting
the listbox.listindex to the stored value. I have tried using
application.screenupdating=true. No joy with any of these.

So any ideas why I need to use a manual move away and then return to
worksheet to see a highlighted selected item in the list? Any ideas to
resolve this so that users are not confused about their selection?

Many thanks,
Jonathan





michael.beckinsale

Listbox selection
 

Jonathan,

Try putting

DoEvents

in the code before activating the worksheet / cell

Regards

Michael Beckinsale


Jonathan

Listbox selection
 
Hi Michael, thanks for the suggestion. Have given it a go to no avail.

Many thanks,
Jonathan

"michael.beckinsale" wrote:


Jonathan,

Try putting

DoEvents

in the code before activating the worksheet / cell

Regards

Michael Beckinsale




All times are GMT +1. The time now is 06:55 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com