Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel 97 Combo Box problem

Status
Not open for further replies.

Roper7

Technical User
Aug 23, 2001
4
0
0
US
I've created a dropdown combo box in Excel 97 that is
populated with items that refer to named ranges on my
worksheet. I want my users to be able to select an option
and be taken to the named range. I populated the box
using the AddItem method, but I can't get the code to work
when they make a selection. Based on info from Help, I am
using the GoTo method with a Select Case. This is the
code I've written:

Private Sub cboProvList_change()

Select Case providers
Case "Medical Provider 1"
Application.Goto Reference:=Range("mdprov1"),
Scroll:=True
Case "Medical Provider 2"
Application.Goto Reference:=Range("mdprov2"),
Scroll:=True
Case "Medical Provider 3"
Application.Goto Reference:=Range("mdprov3"),
Scroll:=True
Case "Dental Provider 1"
Application.Goto Reference:=Range("dnprov1"),
Scroll:=True
Case "Dental Provider 2"
Application.Goto Reference:=Range("dnprov2"),
Scroll:=True
Case "Vision Provider 1"
Range("vpprov1").Select
Application.Goto Reference:=Range("vpprov1"),
Scroll:=True
Case "Vision Provider 2"
Application.Goto Reference:=Range("vpprov2"),
Scroll:=True
End Select
End Sub

What am I doing wrong? Any help would be appreciated.

Lee
 
I would use "MsgBox providers" to see what you have in providers and then fix the case accordingly.

JFLo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top