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
|
Sub test2()
'erreur lors du collage, mes copies se collent dans des colonnes consécutives
Dim i As Integer
Dim k As Integer
Dim derli As Integer
Dim sh As Worksheet
Dim x As String
x = "YES"
k = 8
Set sh = Worksheets("data")
derli = Columns(1).Find("*", , , , , xlPrevious).Row
For i = 5 To derli
Worksheets("data").Activate
If Cells(i, 22).Value = x Then
adres = Application.Union(Range("a" & i), Range("n" & i), _
Range("o" & i), Range("al" & i), Range("ad" & i), Range("ae" & i), Range("af" & i), _
Range("ag" & i), Range("ah" & i), Range("ai" & i), Range("am" & i), _
Range("ag" & i), Range("ah" & i), Range("ai" & i), Range("am" & i), Range("an" & i), Range("ao" & i), Range("ar" & i), Range("as" & i), _
Range("at" & i), Range("ak" & i), Range("aj" & i), Range("m" & i)).Address
Debug.Print adres
sh.Range(adres).Copy _
Worksheets("FB Fully Redeemed").Cells(k, 1)
k = k + 1
End If
Next i
i = i + 1
End Sub |