Place contents of list box into active cell.


Posted by Ron on June 20, 2001 10:57 AM

I've been trying to setup a list box to work in the following way:

The user selects a cell on the worksheet(any cell) and then clicks a selection in a list box placing the value from the list box into the selected cell.

Is this possible? Thanks!

Posted by Russell on June 20, 2001 11:11 AM

Use a listbox from the Control Toolbox (view-toolbars-control toolbox). After you place the listbox on the form, click on "View Code" (on the toolbar). In the 'Click' event, put code like this:

Private Sub ListBox1_Click()
ActiveCell.Value = ListBox1.Value
End Sub



Posted by Ron on June 20, 2001 12:44 PM

Thanks. Sometimes you need someone to tell you the obvious.

Thanks Russell. I had a brain cramp and should've known that.