1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| Sub cherchertxtetcopie()
dim c as variant
dim CL1 as workbook
dim FL1 as worksheet, FL2 as worksheet
With Worksheets(1).Range("la plage")
Set c = .Find("mon texte", lookin:=xlValues)
If Not c Is Nothing Then
firstAddress = c.Address
Do
set CL1=thisworkbook
set FL1=CL1.worksheet("la feuille origine")
set FL2=CL1.worksheet("la feuille destination")
FL1.Range(""" & firstaddress & ":" & FL1.firstaddress.column + 3 & FL1.firstaddress.row & """).Copy _
Destination:=FL2.Range("A" & FL2.Range("A1"). _
SpecialCells(xlCellTypeLastCell).Row + 1)
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address <> firstAddress
End If
End With
End sub |