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
| Sub test()
Dim monfichier As Workbook
Dim adr As String
Dim recap As String
Dim direc As Integer
Set monfichier = Workbooks.Open("\\Nwanex\donnees\daf\daf4\B236\2007 FACTURES\CHAPITRE 0214- 02\fourre-tout\LISTE DES FACTURES ET BC 2007 TOURRE TOUT")
monfichier.Worksheets(1).Select
Range("1:1").Select
For Each Item In Selection
If Item.Value = "SOLDE" Then
adr = Item.Address
MsgBox (adr)
End If
Next
Range((adr), Range(adr).End(xlDown)).Select
For i = 1 To Selection.Count
If Cells(i, 7).Value > "0" And Cells(i, 7).Value <> "SOLDE" And _
Cells(i, 7).Formula <> "=SOMME(G3:G40)" Then
recap = Cells(i, 7).Address
direc = Cells(i, 7).Count
Range(recap).EntireRow.Copy ThisWorkbook.Worksheets(1).Range("A2")
ThisWorkbook.Worksheets(1).Activate
MsgBox ("tout marche")
End If
Next
Application.CutCopyMode = False
End Sub |
Partager