avant tout merci à FxM pour soluce
comment avec le code ci dessous je peut lister autres chose que des fichier
*.XLS
merci par avance.
Sub dernier_modifie()
Application.ScreenUpdating = False
Set FSO = CreateObject("Scripting.FileSystemObject")
Set fs = Application.FileSearch
With fs
.LookIn = "c:\temp"
.SearchSubFolders = True
.Execute
For Each f In .FoundFiles
Set File = FSO.GetFile(f)
Range("a1") = File.DateLastModified
Range("b1") = f
Range("a1").Insert Shift:=xlDown
Range("b1").Insert Shift:=xlDown
Next f
End With
Set FSO = Nothing
Set File = Nothing
Range("a1").Delete Shift:=xlUp
Range("b1").Delete Shift:=xlUp
Range(Range("a1:b1"), Range("a1").End(xlDown)).Select
Selection.Sort Key1:=Range("A1"), Order1:=xlDescending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False
Range("b1").Select
plus_recent = ActiveCell
Application.DisplayAlerts = True
Application.DisplayAlerts = True
Application.ScreenUpdating = True
avant tout merci à FxM pour soluce comment avec le code ci dessous je peut lister autres chose que des fichier *.XLS merci par avance. Sub dernier_modifie() Application.ScreenUpdating = False Set FSO = CreateObject("Scripting.FileSystemObject") Set fs = Application.FileSearch With fs .LookIn = "c:temp" .SearchSubFolders = True .Execute For Each f In .FoundFiles Set File = FSO.GetFile(f) Range("a1") = File.DateLastModified Range("b1") = f Range("a1").Insert Shift:=xlDown Range("b1").Insert Shift:=xlDown Next f End With Set FSO = Nothing Set File = Nothing Range("a1").Delete Shift:=xlUp Range("b1").Delete Shift:=xlUp Range(Range("a1:b1"), Range("a1").End(xlDown)).Select Selection.Sort Key1:=Range("A1"), Order1:=xlDescending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:úlse Range("b1").Select plus_recent = ActiveCell Application.DisplayAlerts = True Application.DisplayAlerts = True Application.ScreenUpdating = True
End Sub
Salut Patrick,
Rajoute ceci avant Execute :
.FileType = msoFileTypeAllFiles
avant tout merci à FxM pour soluce
comment avec le code ci dessous je peut lister autres chose que des
fichier
*.XLS
merci par avance.
Sub dernier_modifie()
Application.ScreenUpdating = False
Set FSO = CreateObject("Scripting.FileSystemObject")
Set fs = Application.FileSearch
With fs
.LookIn = "c:temp"
.SearchSubFolders = True
.Execute
For Each f In .FoundFiles
Set File = FSO.GetFile(f)
Range("a1") = File.DateLastModified
Range("b1") = f
Range("a1").Insert Shift:=xlDown
Range("b1").Insert Shift:=xlDown
Next f
End With
Set FSO = Nothing
Set File = Nothing
Range("a1").Delete Shift:=xlUp
Range("b1").Delete Shift:=xlUp
Range(Range("a1:b1"), Range("a1").End(xlDown)).Select
Selection.Sort Key1:=Range("A1"), Order1:=xlDescending,
Header:=xlGuess, _ OrderCustom:=1, MatchCase:úlse
Range("b1").Select
plus_recent = ActiveCell
Application.DisplayAlerts = True
Application.DisplayAlerts = True
Application.ScreenUpdating = True
avant tout merci à FxM pour soluce comment avec le code ci dessous je peut lister autres chose que des fichier *.XLS merci par avance. Sub dernier_modifie() Application.ScreenUpdating = False Set FSO = CreateObject("Scripting.FileSystemObject") Set fs = Application.FileSearch With fs .LookIn = "c:temp" .SearchSubFolders = True .Execute For Each f In .FoundFiles Set File = FSO.GetFile(f) Range("a1") = File.DateLastModified Range("b1") = f Range("a1").Insert Shift:=xlDown Range("b1").Insert Shift:=xlDown Next f End With Set FSO = Nothing Set File = Nothing Range("a1").Delete Shift:=xlUp Range("b1").Delete Shift:=xlUp Range(Range("a1:b1"), Range("a1").End(xlDown)).Select Selection.Sort Key1:=Range("A1"), Order1:=xlDescending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:úlse Range("b1").Select plus_recent = ActiveCell Application.DisplayAlerts = True Application.DisplayAlerts = True Application.ScreenUpdating = True
End Sub
michdenis
Bonsoir CEBE,.
Moi, j'ajouterais :
Sub dernier_modifie() Application.ScreenUpdating = False Set FSO = CreateObject("Scripting.FileSystemObject") Set fs = Application.FileSearch With fs .LookIn = "c:temp" .SearchSubFolders = True .FileName = "*.*" '.../ etc
Salutations!
"CEBE Patrick" a écrit dans le message de news:403e3a2f$0$28619$ avant tout merci à FxM pour soluce comment avec le code ci dessous je peut lister autres chose que des fichier *.XLS merci par avance. Sub dernier_modifie() Application.ScreenUpdating = False Set FSO = CreateObject("Scripting.FileSystemObject") Set fs = Application.FileSearch With fs .LookIn = "c:temp" .SearchSubFolders = True .Execute For Each f In .FoundFiles Set File = FSO.GetFile(f) Range("a1") = File.DateLastModified Range("b1") = f Range("a1").Insert Shift:=xlDown Range("b1").Insert Shift:=xlDown Next f End With Set FSO = Nothing Set File = Nothing Range("a1").Delete Shift:=xlUp Range("b1").Delete Shift:=xlUp Range(Range("a1:b1"), Range("a1").End(xlDown)).Select Selection.Sort Key1:=Range("A1"), Order1:=xlDescending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:úlse Range("b1").Select plus_recent = ActiveCell Application.DisplayAlerts = True Application.DisplayAlerts = True Application.ScreenUpdating = True
End Sub
Bonsoir CEBE,.
Moi, j'ajouterais :
Sub dernier_modifie()
Application.ScreenUpdating = False
Set FSO = CreateObject("Scripting.FileSystemObject")
Set fs = Application.FileSearch
With fs
.LookIn = "c:temp"
.SearchSubFolders = True
.FileName = "*.*"
'.../ etc
Salutations!
"CEBE Patrick" <cebe.patrick@free.fr> a écrit dans le message de news:403e3a2f$0$28619$626a14ce@news.free.fr...
avant tout merci à FxM pour soluce
comment avec le code ci dessous je peut lister autres chose que des fichier
*.XLS
merci par avance.
Sub dernier_modifie()
Application.ScreenUpdating = False
Set FSO = CreateObject("Scripting.FileSystemObject")
Set fs = Application.FileSearch
With fs
.LookIn = "c:temp"
.SearchSubFolders = True
.Execute
For Each f In .FoundFiles
Set File = FSO.GetFile(f)
Range("a1") = File.DateLastModified
Range("b1") = f
Range("a1").Insert Shift:=xlDown
Range("b1").Insert Shift:=xlDown
Next f
End With
Set FSO = Nothing
Set File = Nothing
Range("a1").Delete Shift:=xlUp
Range("b1").Delete Shift:=xlUp
Range(Range("a1:b1"), Range("a1").End(xlDown)).Select
Selection.Sort Key1:=Range("A1"), Order1:=xlDescending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:úlse
Range("b1").Select
plus_recent = ActiveCell
Application.DisplayAlerts = True
Application.DisplayAlerts = True
Application.ScreenUpdating = True
Sub dernier_modifie() Application.ScreenUpdating = False Set FSO = CreateObject("Scripting.FileSystemObject") Set fs = Application.FileSearch With fs .LookIn = "c:temp" .SearchSubFolders = True .FileName = "*.*" '.../ etc
Salutations!
"CEBE Patrick" a écrit dans le message de news:403e3a2f$0$28619$ avant tout merci à FxM pour soluce comment avec le code ci dessous je peut lister autres chose que des fichier *.XLS merci par avance. Sub dernier_modifie() Application.ScreenUpdating = False Set FSO = CreateObject("Scripting.FileSystemObject") Set fs = Application.FileSearch With fs .LookIn = "c:temp" .SearchSubFolders = True .Execute For Each f In .FoundFiles Set File = FSO.GetFile(f) Range("a1") = File.DateLastModified Range("b1") = f Range("a1").Insert Shift:=xlDown Range("b1").Insert Shift:=xlDown Next f End With Set FSO = Nothing Set File = Nothing Range("a1").Delete Shift:=xlUp Range("b1").Delete Shift:=xlUp Range(Range("a1:b1"), Range("a1").End(xlDown)).Select Selection.Sort Key1:=Range("A1"), Order1:=xlDescending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:úlse Range("b1").Select plus_recent = ActiveCell Application.DisplayAlerts = True Application.DisplayAlerts = True Application.ScreenUpdating = True