Private Sub CommandButton1_Click()
Dim X As Integer
Dim Y As String
Dim worksheets As String
If ComboBox4.Value = "PMC" And ComboBox3.Value = Sheets("744 ocv pmc").Range("c66").Value Then
ACTIVEWORKBOOK.worksheets("744 OCV PMC").Activate
X = Application.WorksheetFunction.Match(Cells(1651, 1), Range("B1:Q1"), 0)
Y = Application.WorksheetFunction.Match(Range("A1650"), Range("A2:A17"), 0)
ElseIf ComboBox4.Value = "PMC" And ComboBox3.Value = Sheets("744 ocv pmc").Range("c67").Value Then
ACTIVEWORKBOOK.worksheets("744 WCV PMC").Activate
X = Application.WorksheetFunction.Match(Cells(1651, 1), Range("B1:q1"), 0)
Y = Application.WorksheetFunction.Match(Cells(1650, 1), Range("A2:A17"), 0)
ElseIf ComboBox4.Value = "PMC" And ComboBox3.Value = Sheets("744 ocv pmc").Range("c68").Value Then
ACTIVEWORKBOOK.worksheets("748 PMC").Activate
X = Application.WorksheetFunction.Match(Cells(1651, 1), Range("B1:T1"), 0)
Y = Application.WorksheetFunction.Match(Range("A1650"), Range("A2:A17"), 0)
ElseIf ComboBox4.Value = "PRF" And ComboBox3.Value = Sheets("744 ocv pmc").Range("c66").Value Then
ACTIVEWORKBOOK.worksheets("744 OCV 16FT").Activate
X = Application.WorksheetFunction.Match(Cells(1651, 1), Range("B1:m1"), 0)
Y = Application.WorksheetFunction.Match(Range("A1650"), Range("A2:A17"), 0)
ElseIf ComboBox4.Value = "PRF" And ComboBox3.Value = Sheets("744 ocv pmc").Range("c67").Value Then
ACTIVEWORKBOOK.worksheets("744 WCV 16FT").Activate
X = Application.WorksheetFunction.Match(Cells(1651, 1), Range("B1:M1"), 0)
Y = Application.WorksheetFunction.Match(Range("A1650"), Range("A2:A17"), 0)
ElseIf ComboBox4.Value = "PRF" And ComboBox3.Value = Sheets("744 ocv pmc").Range("c68").Value Then
ACTIVEWORKBOOK.worksheets("748 16FT").Activate
X = Application.WorksheetFunction.Match(Cells(1651, 1), Range("B1:Q1"), 0)
Y = Application.WorksheetFunction.Match(Range("A1650"), Range("A2:A17"), 0)
ElseIf ComboBox4.Value = "PGA" And ComboBox3.Value = Sheets("744 ocv pmc").Range("c66").Value Then
ACTIVEWORKBOOK.worksheets("744 OCV 20FT").Activate
X = Application.WorksheetFunction.Match(Cells(1651, 1), Range("B1:M1"), 0)
Y = Application.WorksheetFunction.Match(Range("A1650"), Range("A2:A17"), 0)
ElseIf ComboBox4.Value = "PGA" And ComboBox3.Value = Sheets("744 ocv pmc").Range("c67").Value Then
ACTIVEWORKBOOK.worksheets("744 WCV 20FT").Activate
X = Application.WorksheetFunction.Match(Cells(1651, 1), Range("B1:M1"), 0)
Y = Application.WorksheetFunction.Match(Range("A1650"), Range("A2:A17"), 0)
ElseIf ComboBox4.Value = "PGA" And ComboBox3.Value = Sheets("744 ocv pmc").Range("c68").Value Then
ACTIVEWORKBOOK.worksheets("748 20FT").Activate
X = Application.WorksheetFunction.Match(Cells(1651, 1), Range("B1:Q1"), 0)
Y = Application.WorksheetFunction.Match(Range("A1650"), Range("A2:A17"), 0)
End If
MsgBox Cells(Y + 1, X + 1)
ComboBox1.Value = ""
ComboBox5.Value = ""
Unload Me
End Sub
Private Sub ComboBox1_Change()
ActiveSheet.Cells(1650, 1).Value = ComboBox1.Text
End Sub
Private Sub ComboBox5_Change()
ActiveSheet.Cells(1651, 1).Value = ComboBox5.Text
End Sub
Bookmarks