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
| Private Sub CommandButton1_Click()
Dim data As Worksheet
Dim boutique As Worksheet
Dim cell As Range
Dim Pays As Integer
Dim Jo As Integer
Set data = ThisWorkbook.Sheets("Data")
Set boutique = ThisWorkbook.Sheets("boutique JO")
On Error Resume Next
For Each cell In data.Range("a2:a" & data.Range("A" & Rows.Count).End(xlUp).Row)
Pays = boutique.Rows(2).Find(cell).Column
If Pays <> 0 Then
With boutique
Jo = .Range(boutique.Cells(3, Pays), .Cells(3, .Cells(3, Pays).End(xlToRight).Column)).Find(cell.Offset(0, 8).Value, , xlValues).Column
If Jo <> 0 Then
'ou ceci.Cells(.Cells(65000, Jo).End(xlUp).Row + 1, Jo).Value = cell.Offset(0, 3).Value
.Cells(cell.Row + 3, Jo).Value = cell.Offset(0, 3).Value
End If
End With
End If
Pays = 0
Jo = 0
Next cell
End Sub |
Partager