Re : problème mémoire virtuelle avec find
Voici d'ailleurs le code:
Set WordApp = Nothing
UserForm1.Hide
Worksheets("résultats").Range("A2:G50000").ClearContents
Worksheets("résultats").Range("A2:F50").Interior.ColorIndex = 0
Worksheets("dossiers").Activate
Dim ValAChercher
Dim couleur
Dim NextRow As Long
Dim Entry1 As String, Entry2 As String, Entry3 As String, Entry4 As String, Entry5 As String, Entry6 As String, Entry7 As String
Dim macell As Range, premcell As Range
ValAChercher = InputBox("Uniquement nom ou partie du nom de famille :")
With Worksheets("dossiers").Range("b1:b50000")
Set macell = .Find(ValAChercher, LookIn:=xlValues)
If Not macell Is Nothing Then
Set premcell = macell
Do
NextRow = Worksheets("résultats").Range("A65536").End(xlUp).Row + 1
Entry1 = macell.Offset(0, 0).Value
Entry2 = macell.Offset(0, 1).Value
Entry3 = macell.Offset(0, 2).Value
Entry4 = macell.Offset(0, 3).Value
Entry5 = macell.Offset(0, -1).Value & "-" & macell.Offset(0, 4).Value
Entry6 = macell.Offset(0, 5).Value
Entry7 = macell.Offset(0, 6).Value & " / " & macell.Offset(0, 7).Value
Worksheets("résultats").Activate
Cells(NextRow, 1) = Entry1
Cells(NextRow, 1).Interior.ColorIndex = macell.Offset(0, 0).Interior.ColorIndex
Cells(NextRow, 2) = Entry2
Cells(NextRow, 2).Interior.ColorIndex = macell.Offset(0, 1).Interior.ColorIndex
Cells(NextRow, 3) = Entry3
Cells(NextRow, 3).Interior.ColorIndex = macell.Offset(0, 2).Interior.ColorIndex
Cells(NextRow, 4) = Entry4
Cells(NextRow, 4).Interior.ColorIndex = macell.Offset(0, 3).Interior.ColorIndex
Cells(NextRow, 5) = Entry5
Cells(NextRow, 5).Interior.ColorIndex = macell.Offset(0, -1).Interior.ColorIndex
Cells(NextRow, 6) = Entry6
Cells(NextRow, 7) = Entry7
Set macell = .FindNext(macell)
Loop While Not macell Is Nothing And Not macell.Address = premcell.Address
End If
End With
Columns("E:E").Select
Range("A1:L50000").Sort Key1:=Range("A2"), Order1:=xlDescending, Header:= _
xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Range("A1").Select
End sub