Go To combobox

G

gregork

Hi,
I have inserted a combobox on a worksheet that I want to act as a record
selector for showing one record from my list of 500+ entries. Trouble is I
have no idea how to write a code to achieve this. Any help or sample odes
would be appreciated.

Regards
gregork
 
B

Bob Phillips

Grgeor,

From previous posts I will assume an activeX control. You need to identify a
key column, lets say B. Set the ListFillrange property for the cells in
column B, and then use the .ListIndex property on a combobox click event to
identify which record (it will equate to the row - 1).

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
G

gregork

Thanks Bob. I've managed to set the ListFillrange property successfully and
my combobox now displays a list of all the records in A3:A500 but I am
afraid you lost me on the code for the click event. Could you be more
specific I have no idea how to write a code to make the cell I selected in
the combobox be the go to cell . I guess I would need to make the cell
selected highlighted or maybe just have the cursor go to the cell.

Many Thanks
gregork
 
B

Bob Phillips

Gregor,

Let's assume that the records are in the range H1:M500. The click event
would look like this

Private Sub ComboBox1_Click()
Range("H1:M500")(ComboBox1.ListIndex + 1, 1).Select
End Sub

It would be better to name the range and use that of course.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Top