Sub planning()
Dim f1 As Worksheet, f2 As Worksheet
Set f1 = Sheets("data")
Set f2 = Sheets("csv")
f2.Select
With f2
.Range("a1:T1000").ClearContents
lig2 = f1.Cells(f1.Rows.Count, 8).End(xlUp).Row
For x = 2 To lig2
y = .Cells(.Rows.Count, 1).End(xlUp).Row + 1
f2.Cells(1, 1) = f1.Cells(1, 28)
If f1.Cells(x, 28) = f1.Cells(x, 8) Then '
.Cells(y, 1) = f1.Cells(x, 1)
.Cells(y, 2) = f1.Cells(x, 2)
.Cells(y, 3) = f1.Cells(x, 3)
.Cells(y, 4) = f1.Cells(x, 4)
.Cells(y, 5) = f1.Cells(x, 5)
.Cells(y, 6) = f1.Cells(x, 6)
.Cells(y, 7) = f1.Cells(x, 7)
End If
Next x
End With
Call SaveAsCSV
Application.ScreenUpdating = True
f1.Select
End Sub