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
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