PDA

Visualizza versione completa : Ottimizzare la ricerca in un foglio Excel


Superbisco
18-03-2010, 18.22.42
Girando per la rete ho trovato questo codice (http://p2p.wrox.com/excel-vba/78378-worksheetfunction-match-function-problem-excel-2010-a.html) per la ricerca all'interno di un foglio excel.


Private Function GetRowFound(vToFind As Variant, rFindIn As Range) As Long 'Row will never be a decimal number

'Finds first cell where match is found and returns the row.
'vToFind is what you are looking for. Used variant so can be whatever is passed in
'rFindIn is a range of cells in a row, such as range("A:A") or range("A1:A250").
'rFound will be a reference to the cell where value is first found
Dim rFound As Range
Set rFound = rFindIn.Find(vToFind, LookIn:=xlValues)
If rFound Is Nothing Then GetRowFound = 0 Else GetRowFound = rFound.Row

End Function


Il problema che non molto performante.

Conoscete un metodo pi veloce?