Sub caccola_vfrac()
Dim table As Range, first As Range, second As Range
Set table = [a1:e18] '<-- range che contiene i numeri, da A a E
Set first = table.Find([g3], lookat:=xlWhole)
Set second = table.Find([h3], lookat:=xlWhole)
If first Is Nothing Or second Is Nothing Then
MsgBox "Caccolo fallito_ Inserisci 2 dumeri compresi tra 1 e 90! O_o"
Exit Sub
End If
If first.Row = second.Row Or first.Column = second.Column Then
MsgBox " I numeri scelti devono essere su righe/colonne differenti"
Exit Sub
End If
[j3] = Cells(second.Row, first.Column)
[k3] = Cells(first.Row, second.Column)
End Sub |