Hi all,
Could somebody let me now how I can call my navigate sub from the .OnAction line within my code attached please. Or is there another way I can navigate to specific cells on selection of a value from the combo box.
Could somebody let me now how I can call my navigate sub from the .OnAction line within my code attached please. Or is there another way I can navigate to specific cells on selection of a value from the combo box.
Code:
Private Sub Worksheet_Activate()
Set newcombo = CommandBars("Engineer Selection").Controls.Add(Type:=msoControlComboBox)
With newcombo
.AddItem "Adams"
.AddItem "Bezuidenhout"
.AddItem "Bunce"
.AddItem "Cambridge"
.AddItem "Collins"
.AddItem "Donnelly"
.AddItem "Henry"
.AddItem "Michna"
.AddItem "Milnes"
.AddItem "O'Connell"
.AddItem "O'Sullivan"
.AddItem "Spencer"
.AddItem "Warren"
.AddItem "Wright"
.AddItem "Naeem"
.AddItem "Other"
.Style = msoComboNormal
.OnAction = Navigate()
End With
End Sub
Private Sub Navigate()
Select Case newcombo.Text
Case "Adams"
Range("A8").Select
Case "Bezuidenhout"
Range("A43").Select
Case "Bunce"
Range("A75").Select
Case "Cambridge"
Range("A108").Select
Case "Collins"
Range("A141").Select
Case "Donnelly"
Range("A174").Select
Case "Donnelly"
Range("A174").Select
Case "Henry"
Range("A207").Select
Case "Michna"
Range("A240").Select
Case "Milnes"
Range("A273").Select
Case "O'Connell"
Range("A306").Select
Case "O'Sullivan"
Range("A339").Select
Case "Spencer"
Range("A372").Select
Case "Warren"
Range("A405").Select
Case "Wright"
Range("A439").Select
Case "Naeem"
Range("A473").Select
Case "Other"
Range("A508").Select
End Select
End Sub