ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Dynamically assign items to a list box (https://www.excelbanter.com/excel-programming/306594-dynamically-assign-items-list-box.html)

Fernando Ronci

Dynamically assign items to a list box
 
Hi,

Is there a way to automatically add items to a list box and then
programatically act according to the item selected by the user ?
This is the scenario:
I have a spreadsheet that keeps statistics of basketball games. Each time
the assistant to the coach needs to add the stats of a new game, he/she
clicks on a button (which is linked to a macro) and a new blank template is
appended to the end of the sheet. Then he/she fills the recently added
template and some calculations are done. Before exiting, the spreadsheet is
saved. I've been able to implement this by means of a couple of macros and a
bit of user-interface design. So far, so good.
The problem is that as long as the spreadsheet grows, it is more and more
time-consuming to locate the stats of any given game, requiring many
page-up's and page-down's and/or Edit | Search, so I thought that a feature
to automatically "jump" to the stats of the game of choice may come handy.
For this task, I thought of adding a list box (which should be linked to a
macro) whose items must be picked from -for example- the first cell of the
first row of every game, and then, according to the item or "game" selected
by the user, jump to that stat. That simple. I thought of creating an
autoexecutable macro that could -for example- run when the .XLS file is
opened and create the list box on the fly, however, although I can
programatically parse the whole sheet and read the content of the cells that
identify each game, I don't know how to feed the content of these cells to
the list box. I have no doubts it has to be possible to implement this.

I'll highly appreciate if someone points me in the right direction to
achieve my goal.
Thank you,

Fernando Ronci
E-mail:




All times are GMT +1. The time now is 10:34 AM.

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