A B C 1 Nom Date/Heure Nouveau Nom 2 x.xls xxxxx 3 y.xls xxxxx yy.xls 4 z.xls xxxxx
http://cjoint.com/?mufNdNQSvE
Sub ListeFichiers() Range("A2:E65000").ClearContents ChDir ActiveWorkbook.Path ' répertoire de l'appli ligne = 2 nf = Dir("*.xls") 'premier fichier xls Do While nf <> "" Cells(ligne, 1) = nf Cells(ligne, 2) = FileDateTime(nf) ligne = ligne + 1 nf = Dir ' suivant Loop End Sub
Sub modifieNom() For Each c In Range([A2], [A2].End(xlDown)) If c.Offset(0, 2) <> "" Then Name c.Value As c.Offset(0, 2).Value End If Next c
Pour choisir le repertoire:
Function ChoixDossier() If Val(Application.Version) >= 10 Then With Application.FileDialog(msoFileDialogFolderPicker) .InitialFileName = ActiveWorkbook.Path & "" .Show If .SelectedItems.Count > 0 Then ChoixDossier = .SelectedItems(1) Else ChoixDossier = "" End If End With Else ChoixDossier = InputBox("Répertoire?") End If End Function
' dossier = ChoixDossier() ' If dossier = "" Then Exit Sub
Cordialement JB
Bonjour,
A B C
1 Nom Date/Heure Nouveau Nom
2 x.xls xxxxx
3 y.xls xxxxx yy.xls
4 z.xls xxxxx
http://cjoint.com/?mufNdNQSvE
Sub ListeFichiers()
Range("A2:E65000").ClearContents
ChDir ActiveWorkbook.Path ' répertoire de l'appli
ligne = 2
nf = Dir("*.xls") 'premier fichier xls
Do While nf <> ""
Cells(ligne, 1) = nf
Cells(ligne, 2) = FileDateTime(nf)
ligne = ligne + 1
nf = Dir ' suivant
Loop
End Sub
Sub modifieNom()
For Each c In Range([A2], [A2].End(xlDown))
If c.Offset(0, 2) <> "" Then
Name c.Value As c.Offset(0, 2).Value
End If
Next c
Pour choisir le repertoire:
Function ChoixDossier()
If Val(Application.Version) >= 10 Then
With Application.FileDialog(msoFileDialogFolderPicker)
.InitialFileName = ActiveWorkbook.Path & ""
.Show
If .SelectedItems.Count > 0 Then
ChoixDossier = .SelectedItems(1)
Else
ChoixDossier = ""
End If
End With
Else
ChoixDossier = InputBox("Répertoire?")
End If
End Function
' dossier = ChoixDossier()
' If dossier = "" Then Exit Sub
A B C 1 Nom Date/Heure Nouveau Nom 2 x.xls xxxxx 3 y.xls xxxxx yy.xls 4 z.xls xxxxx
http://cjoint.com/?mufNdNQSvE
Sub ListeFichiers() Range("A2:E65000").ClearContents ChDir ActiveWorkbook.Path ' répertoire de l'appli ligne = 2 nf = Dir("*.xls") 'premier fichier xls Do While nf <> "" Cells(ligne, 1) = nf Cells(ligne, 2) = FileDateTime(nf) ligne = ligne + 1 nf = Dir ' suivant Loop End Sub
Sub modifieNom() For Each c In Range([A2], [A2].End(xlDown)) If c.Offset(0, 2) <> "" Then Name c.Value As c.Offset(0, 2).Value End If Next c
Pour choisir le repertoire:
Function ChoixDossier() If Val(Application.Version) >= 10 Then With Application.FileDialog(msoFileDialogFolderPicker) .InitialFileName = ActiveWorkbook.Path & "" .Show If .SelectedItems.Count > 0 Then ChoixDossier = .SelectedItems(1) Else ChoixDossier = "" End If End With Else ChoixDossier = InputBox("Répertoire?") End If End Function
' dossier = ChoixDossier() ' If dossier = "" Then Exit Sub
Cordialement JB
DOC Prod
Helo tous
Hé JB
à voir les codes t'as un PC. tu devrais t'essayer sur Mac, c'est fun. Lol
ciao a plus
Helo tous
Hé JB
à voir les codes t'as un PC.
tu devrais t'essayer sur Mac, c'est fun. Lol