M
marie
Guest
voici le code que j'ai mis
Option Explicit
Sub Macro1()
'
' Macro1 Macro
' Macro enregistrée le 23/06/2005 par FCI
'
Workbooks.Open ('G:\\COMPTA2005\\Transports\\Détail factures TNT 2005')
Application.ScreenUpdating = False
Dim X, Y, Z As Integer
For X = 1 To 65536
If Worksheets('Détail').Cells(X, 1) = '29905' Then
Z = Workbooks('TNT.xls').Worksheets('Feuil2').Range('A65536').End(xlUp).Row
For Y = 1 To 30
Workbooks('TNT.xls').Worksheets('Feuil2').Cells(Z, Y) = Workbooks('Détail factures TNT 2005').Worksheets('Détail').Cells(X, Y) Next
End If
Next
Application.ScreenUpdating = True
ActiveWindow.Close
End Sub
Ce qui est rouge j'ai erreur du type 9 il me dise d'utiliser for each next mais je sais pas comment faire
Merci
Option Explicit
Sub Macro1()
'
' Macro1 Macro
' Macro enregistrée le 23/06/2005 par FCI
'
Workbooks.Open ('G:\\COMPTA2005\\Transports\\Détail factures TNT 2005')
Application.ScreenUpdating = False
Dim X, Y, Z As Integer
For X = 1 To 65536
If Worksheets('Détail').Cells(X, 1) = '29905' Then
Z = Workbooks('TNT.xls').Worksheets('Feuil2').Range('A65536').End(xlUp).Row
For Y = 1 To 30
Workbooks('TNT.xls').Worksheets('Feuil2').Cells(Z, Y) = Workbooks('Détail factures TNT 2005').Worksheets('Détail').Cells(X, Y) Next
End If
Next
Application.ScreenUpdating = True
ActiveWindow.Close
End Sub
Ce qui est rouge j'ai erreur du type 9 il me dise d'utiliser for each next mais je sais pas comment faire
Merci