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
| Sub test0()
Dim w As Workbook
Dim classeur As String
Dim chemin As String
chemin = "F:\Essai LAC\"
classeur = Dir(chemin & "*.xls")
While classeur <> ""
Set w = Application.Workbooks.Open(chemin & classeur)
ThisWorkbook.Sheets("New COMMERCIAL").Copy Before:=w.Sheets("COMMERCIAL")
Range("C3:Q12").Select
Cells.Replace What:="'[Test DUPONT J.xls]", Replacement:="", LookAt:= _
xlPart, SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Cells.Replace What:="'[Test DUPONT J.xls]", Replacement:="'", LookAt:= _
xlPart, SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Range("C3:Q12").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("A1").Select
w.Save
w.Close
classeur = Dir
Wend
End Sub |
Partager