1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
|
Sub test_f()
Dim F As Worksheet
Dim client As String
Dim montant As Double
Dim i, j As Integer
For i = 2 To 3000
client = Cells(i, 1)
montant = Cells(i, 5)
Cells(i, 11) = "non trouve"
If (client <> "0") Then
For Each F In Sheets
If (F.Name <> "Feuil1" And Left(F.Name, 2) = "CA") Then
Sheets(F.Name).Select
For j = 7 To 1000
'Debug.Print "client " & Cells(j, 2) & "colonne BI : " & Cells(j, 61)
If (Cells(j, 2) = "10001") Then
Debug.Print "trouve"
Debug.Print Round(Cells(j, 61), 2)
End If
If (Cells(j, 2) = client And Round(Cells(j, 61), 2) = montant) Then
Cells(i, 11) = "trouve"
Exit For
End If
Next j
End If
Next F
End If
If (client <> "0") Then
Sheets("Feuil1").Select
End If
Next i
End Sub |
Partager