Moderatori: Anthony47, Flash30005
Function GoodLuck(ByVal myEstr As Long, ByRef MyTabb As Range) As Variant
Dim oArr(1 To 5), vArr, myMatch, J As Long, I As Long
Dim pCols As Long, myRow, cMax As Integer, ciPPa As Long
'
pCols = Application.Caller.Columns.Count
'
For I = 1 To 3
vArr = Application.WorksheetFunction.Index(MyTabb, 0, 1 + (I - 1) * 17)
myMatch = Application.Match(myEstr, vArr, 0)
If Not IsError(myMatch) Then
myRow = MyTabb.Cells(myMatch, 1 + (I - 1) * 17).Resize(1, 16).Value
cMax = 0
For J = 1 To pCols
cMax = 0
For k = 1 To 15
If myRow(1, 1 + k) > cMax And IsNumeric(myRow(1, 1 + k)) Then
cMax = myRow(1, 1 + k)
ciPPa = k
End If
Next k
oArr(J) = MyTabb.Cells(myMatch, 1 + (I - 1) * 17 + ciPPa).End(xlUp).Value
myRow(1, 1 + ciPPa) = 0
Next J
Exit For
End If
Next I
GoodLuck = oArr
End Function
=GoodLuck(B11;$I$2:$BF$35)
=GoodLuck(NumeroDaEsaminare;TabelloneConLeProbabilità)
=GoodLuck(A2;BARI!$I$2:$BF$35)
Anthony ha scritto:Poi torna sul foglio BARI, seleziona le celle C11:F11, e scrivi questa formula nella barra della formula:
- Codice: Seleziona tutto
=GoodLuck(B11;$I$2:$BF$35)
Conferma con Contr-Maiusc-Enter, non il solo Enter
Avrai cosi' i risultati del numero posizionato in B11
Torna a Applicazioni Office Windows
Visitano il forum: Nessuno e 5 ospiti