ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Go To combobox (https://www.excelbanter.com/excel-programming/291670-go-combobox.html)

gregork

Go To combobox
 
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



Bob Phillips[_6_]

Go To combobox
 
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)

"gregork" wrote in message
...
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





gregork

Go To combobox
 
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


"Bob Phillips" wrote in message
...
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)

"gregork" wrote in message
...
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







Bob Phillips[_6_]

Go To combobox
 
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)

"gregork" wrote in message
...
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


"Bob Phillips" wrote in message
...
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)

"gregork" wrote in message
...
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









gregork

Go To combobox
 
Thanks for spelling it out for me Bob.

Kind Regards
gregork

"Bob Phillips" wrote in message
...
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)

"gregork" wrote in message
...
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


"Bob Phillips" wrote in message
...
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)

"gregork" wrote in message
...
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












All times are GMT +1. The time now is 02:44 PM.

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