Kouik Kouik jr
XLDnaute Occasionnel
Bonsoir le forum,
mon code qui marchait hier ( je ne l'ai pas modifié entre temps)
bug aujourd'hui et me met error 9 Subscript out of range sur la ligne
Je ne comprends pas pourquoi ?
Voici mon code
Merci d'avance pour toute aide ou infos
mon code qui marchait hier ( je ne l'ai pas modifié entre temps)
bug aujourd'hui et me met error 9 Subscript out of range sur la ligne
HTML:
Sheets("Symb1").Select
Je ne comprends pas pourquoi ?
Voici mon code
Merci d'avance pour toute aide ou infos
HTML:
Sub Chargement_donnees()
Application.DisplayAlerts = False
Application.ScreenUpdating = False
'Chargement données Journal_identifiants
Windows("VBA_RECONCIL.xls").Activate
Sheets("JOURNAL").Select
Cells.Select
Selection.ClearContents
'set path for files - change for your folder
Const myDir3 As String = "V:\3A OPERATIONS\RCHF\VBA Reconcil\Reconciliation ptf\Fichiers"
'set up filesys objects
Set FileSys = New FileSystemObject
Set myFolder = FileSys.GetFolder(myDir3)
'loop through each file and get date last modified. If largest date then store Filename
dteFile = DateSerial(1900, 1, 1)
For Each objFile In myFolder.Files
If objFile.DateLastModified > dteFile Then
dteFile = objFile.DateLastModified
strFilename = objFile.Name
End If
Next objFile
Workbooks.Open myDir3 & "\" & strFilename
Set FileSys = Nothing
Set myFolder = Nothing
Journal_identifiants = ActiveWorkbook.Name
Sheets("Only_yellow").Select
Cells.Select
Selection.Copy
Windows("VBA_RECONCIL.xls").Activate
Sheets("JOURNAL").Select
Range("A1").Select
ActiveSheet.Paste
'Workbooks.Open Filename:=Journal_identifiants
Journal_identifiants = ActiveWorkbook.Name
Sheets("Symb1").Select
Cells.Select
Selection.Copy
Windows("VBA_RECONCIL.xls").Activate
Sheets("Symbol").Select
Range("A1").Select
ActiveSheet.Paste
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub