Dim m As String
Private Sub ComboBox1_Change()
m = ComboBox1.Value
With Sheets(m)
.Activate
.[a1].Select
End With
ComboBox2.ListIndex = -1
End Sub
Private Sub ComboBox2_Change()
Dim i As Long
With Sheets(m)
For i = 1 To .[a65536].End(xlUp).Row
If .Cells(i, 1).Value = ComboBox2.Value Then
.Cells(i, 1).Select
Exit For
End If
Next i
End With
End Sub
Private Sub UserForm_Initialize()
Dim S As Worksheet
Dim var
Set S = ThisWorkbook.Sheets("PDG")
var = S.Range("a2:a" & S.[a1].End(xlDown).Row & "")
ComboBox1.List = var
var = S.Range("b2:b" & S.[b1].End(xlDown).Row & "")
ComboBox2.List = var
End Sub