how to position a listbox???
Seems simple, but not so easy. The listbox is a variation of the Shape
object, which has a top, left, height and width that can be set. The problem
is determining what the settings should be. First of all, how do you know
when the selected cell is in the top or bottom half of the screen? That
itself is tricky. Depends on the cell address, the current scroll position
of the worksheet, as well as the height of all the columns and width of the
rows. You can use the Application.Window object to try to figure all this
out. Then calculate your offset (horizontal, vertical) in points to set the
top and left of your listbox. I'm afraid I don't have time to work this all
out, but at least this gives a path to a possible way to do this.
"Brad K." wrote:
I have a macro that displays a ListBox when certain cells are clicked on. I
want the ListBox to be just on the right side of the selected cell with the
top of the box at the cell if the cell is in the top half of the screen and
the bottom of the box if it is in the bottom half.
Excel 2003, XP
Thanks,
Brad
|