Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
recently used files, more efficient
Public Sub EditRecentFiles()
' Created by Patricia Shannon 04/04/2006 ' Displays Recently Used files ' Allows selected files to be removed from the list ' This is a little more efficient than the other one. ' Doesn't matter so much in this little macro, but I wanted to replace the other one to set a good example for those learning VBA Dim RecentCntr Dim NbrRecent Dim Response Dim HoldRecentFile As RecentFile NbrRecent = Application.RecentFiles.Count MsgBox "Nbr recent files=" & NbrRecent 'Set HoldRecentFile = Application.RecentFiles(1) 'MsgBox TypeName(Application.RecentFiles(1)) For RecentCntr = NbrRecent To 1 Step -1 Set HoldRecentFile = Application.RecentFiles(RecentCntr) Response = MsgBox("cntr=" & RecentCntr & " " _ & HoldRecentFile.Name _ & vbNewLine & "Delete?", vbYesNoCancel + vbDefaultButton2) Select Case Response Case vbCancel GoTo endpgm Case vbYes HoldRecentFile.Delete MsgBox "File deleted from recent files list" End Select Next RecentCntr endpgm: End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
recently used files, cleanup | Excel Discussion (Misc queries) | |||
Sharing read-write Excel 2003 files | Excel Discussion (Misc queries) | |||
Recently used files | Excel Worksheet Functions | |||
Recently Used File List - 2002 Contains 'Temp' Files | Excel Discussion (Misc queries) | |||
how to clear the recently used files and still keep settings to k. | Excel Discussion (Misc queries) |