1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
| Option Explicit
Dim typalim As String
Dim modecon As String
Dim typf As String
Dim esp As String
Dim cycl As String
Dim appstad As String
Dim stad As String
Dim stadtyp As String
Dim ENT As Single
Sub CommandButton1_Click()
typalim = ComboBox1.Value
modecon = ComboBox2.Value
typf = ComboBox3.Value
esp = ComboBox4.Value
cycl = ComboBox5.Value
appstad = ComboBox6.Value
stad = ComboBox7.Value
Dim rngData As Range, rngLabelRow1 As Range, rngLabelRow2 As Range, rngLabelRow3 As Range, rngLabelRow4 As Range, rngLabelRow5 As Range, rngLabelRow6 As Range, rngLabelRow7 As Range, rngLabelColumn As Range, fn As WorksheetFunction
Set fn = Application.WorksheetFunction
With ThisWorkbook1.Worksheets("Feuil2")
Set rngData = .Range("H2:O70")
Set rngLabelRow1 = .Range("A2:A70")
Set rngLabelRow2 = .Range("B2:B70")
'Set rngLabelRow3 = .Range("C2:C70")
'Set rngLabelRow4 = .Range("D2:D70")
'Set rngLabelRow5 = .Range("E2:E70")
'Set rngLabelRow6 = .Range("F2:F70")
'Set rngLabelRow7 = .Range("G2:G70")
Set rngLabelColumn = .Range("H1:O1")
End With
With fn
ENT = .Index(rngData, .Match(typalim, rngLabelRow1, 0), .Match(modecon, rngLabelRow2, 0), .Match("EN", rngLabelColumn, 0))
'ENT = .Index(rngData, .Match(typalim, rngLabelRow1, 0), .Match(modecon, rngLabelRow2, 0), .Match(typf, rngLabelRow7, 0), .Match(esp, rngLabelRow3, 0), .Match(cycl, rngLabelRow4, 0), .Match(appstad, rngLabelRow5, 0), .Match(stad, rngLabelRow6, 0), .Match("EN", rngLabelColumn, 0))
End With
End Sub |
Partager