Bonjour,
Je dispose de la macro ci-dessous.
Je souhaiterai que cette macro enregistre les fichiers crées en xls prenant en charge les macros.
Comment faire?
Merci
Sub cutSource()
'
' Macro2 Macro
'Option Explicit
Const nbLignes = 100
Dim J As Long
Dim destWkb As Workbook
Dim fileName As String
Dim Lgder As Long
Dim Nblg As Integer
Application.ScreenUpdating = False
J = 2
Lgder = Range("A65536").End(xlUp).Row
While J < Lgder
Nblg = Application.Min(nbLignes, Lgder + 1 - J)
Range("A" & J & ":J" & J + Nblg - 1).Copy
Set destWkb = Workbooks.Add(ThisWorkbook.Path & "\format Cible.xlsm")
ActiveSheet.Paste Destination:=Range("A2")
fileName = Format(J - 1, "000") & "-" & Format(J + Nblg - 2, "000") & "CC"
destWkb.Close True, ThisWorkbook.Path & "\" & fileName
J = J + Nblg
Wend
End Sub