Excel.Tips.Net Welcome toExcel.Tips.Net

Helpful Links

Tips.Net Home
ExcelTips Home
Ask an Excel Question
Make a Comment

Tips.Net Store

ExcelTips FAQ
ExcelTips Premium

Learn Access Now
Free Printable Forms

Beauty Tips
Car Tips
Cleaning Tips
College Tips
Cooking Tips
Excel2007 Tips
ExcelTips
Family Tips
Gardening Tips
Health Tips
Home Tips
Legal Tips
Money Tips
Organizing Tips
Pest Tips
Pet Tips
Wedding Tips
Word2007 Tips
WordTips

Advertise on the
ExcelTips Site

Newest Tips

Recording a Macro

Adding a Little Animation to Your Life

Converting a Range of URLs to Hyperlinks

Making the Formula Bar Persistent

Engineering Calculations

Digital Signatures for Macros

Fixing the Decimal Point

 

Grabbing the MRU List

Summary: Want to use the list of most recently used files in a macro? You can access it easily by using the technique presented in this tip. (This tip works with Microsoft Excel 97, Excel 2000, Excel 2002, Excel 2003, and Excel 2007.)

Excel allows you to maintain a list of the most-recently used (MRU) files. This list can record the names of up to the last nine workbooks opened and edited within Excel. You can see the MRU list by looking at the bottom of the File menu. If you want to grab the names of the MRU files and insert those names in a worksheet, you can use the following VBA macro:

Sub MostRecent()
    Dim J As Integer

    For J = 1 To Application.RecentFiles.Count
        Cells(J, 1) = Application.RecentFiles(J).Name
    Next J
End Sub

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (2585) applies to Microsoft Excel versions: 97 | 2000 | 2002 | 2003 | 2007

PivotTables Got You Perplexed? PivotTables for the Faint of Heart shows how you can start using Excel's PivotTable tool right away to spin your data into gold! You discover how easy it really is to crunch the numbers you need to crunch. Uncover the power of creating PivotTables, editing them, formatting them, customizing them, and much more.
 
Check out PivotTables for the Faint of Heart today!