View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Pat[_11_] Pat[_11_] is offline
external usenet poster
 
Posts: 12
Default Validation lists

I've tried this and it doesn't completely work. When I
select the name it doesn't go to the sheet. If however, I
activate A1 (by entering the cell then pressing enter) it
works. Any way to change to code to do that?

-----Original Message-----
Hi Pat
assuming that your validation listbox is in cell A1 put

the following
code in the worksheet module of this worksheet:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Then Exit Sub
If Intersect(Target, Me.Range("A1")) Is Nothing Then

Exit Sub
'change this cell reference to your needs
On Error GoTo CleanUp:
With Target
If .Value < "" Then
Worksheets(.Value).Activate
End If
End With
CleanUp:
Application.EnableEvents = True
End Sub


Frank


Pat wrote:
Hi,

I have a drop down box (validation) linked to a list of
names on the same worksheet.

What I want is that when somebody goes to the drop down
list and picks a name they are taken to a worksheet with
that name that already exists in the worksheet.

Can someone help?

Thanks



.