1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
Sub Export()
Dim BASE As Workbook
Dim FD As Worksheet
Dim WS As Worksheet
Dim NBligne As Long, NBcolonne As Long, i As Long, j As Long, compteur As Long
BASE = "C:\Documents and Settings\FRONTIERE-02719\Bureau\doc flo\SAP_DASHBOARD\Export indicateur\Test_Export.xls"
FD = BASE.Worksheet("Feuil1")
WS = ThisWorkbook.Worksheets("Feuil1")
With FD
NBligne = .Cells(.Rows.Count, 1).End(xlUp).Row
NBcolonne = .Cells(1, .Columns.Count).End(xlToLeft).Column
End With
compteur = 1
For i = 2 To NBligne
For j = 1 To NBcolonne - 6
If FD.Cells(i, 2) = "1110" Then compteur = compteur + 1 And WS.Cells(compteur, j) = FD.Cells(i, j + 6)
ElseIf FD.Cells(i,2) <> "1110" then compteur = compteur
Else compteur = compteur
End If
Next j
Next i
End Sub |
Partager