Bah question perf, c'est pas terrible :
si la cellule à trouver se trouve à la position [70,20], on fait 20*70 itérations (*2 comparaisons) : 2800 comparaisons (car je crois que VBA ne fait pas de l'évaluation en "court-circuit" ).
 
Avec deux boucles consécutives, on fait 20+70 : 90 Comparaisons
Code :
 - col_found = -1
 - for colonne = 1 to 20
 -     if (lcase(...)=...)then
 -          col_found = colonne
 -          Exit for
 -     end if
 - next
 - ligne_found = -1
 - for ligne = 1 to 70
 -     if(...) then
 -         ligne_found = ligne
 -         Exit For
 -     end if
 - next
 - if (ligne_found <0 or col_found<0)then
 -     MsgBox("error" )
 -     Exit Sub
 - End if
 
  | 
 
Sinon pour être encore plus efficace, il vaut (bien) mieux utiliser la fonction find
Code :
 - Dim cell_col as Range
 - Dim cell_ligne as Range
 - Set cell_col = ActiveSheet.Range("A1:T1" ).Find(Fruit)
 - Set cell_ligne = ActiveSheet.Range("A1:A70" ).Find(Couleur)
 - if(cell_col is nothing or cell_ligne is nothing) then
 -      MsgBos("erreur" )
 -      Exit Sub
 - Else
 -     ActiveSheet.Cells(cell_ligne.row,cell_col.column) = Note
 - end if
 
  | 
 
Message édité par dreameddeath le 11-02-2008 à 23:19:46