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
| Option Explicit
Dim Reponses As Variant
Sub Test()
'Pour tester la routine d'évaluation sur la ligne N° 1:
MsgBox "Exemple 1 : " & Reponse("- de 1,70 M", "BRUN-NOIR", "NOISETTE", "22 ANS")
End Sub
Function Reponse(mesure_ As String, cheveux As String, yeux As String, age As String) As String
'Ton code pour évaluer la réponse
Call ChargerTableau
'...
'Reponse = NomDeLaFeuille ou "page erreur" :
Reponse = Reponses(1, 5) 'exemple
End Function
Sub ChargerTableau()
Dim DataRange As Range
Set DataRange = ThisWorkbook.Worksheets("FeuilleCachee").Range("A2:E4")
Reponses = DataRange
End Sub |