Opening Workbooks and using a drop down menu

kaileewhiting

New Member
Joined
Oct 3, 2017
Messages
1
Hello fellow Mr. Excel users!

At my company we use Excel to keep and log a lot of our records, many of which need to be inputted into daily. Each workbook is put into one large folder and we float within that folder opening and closing the previous workbook using the command Ctrl-R. When this command is inputted a window saying "Enter the sheet to be activated" is displayed.

However it sometimes can be hard to find the correct workbook that needs to be edited due to poor handwriting. It becomes a pain to have to minimize the current Excel workbook to scroll through the folder to find the one that needs to be open. Is it possible for a scroll bar or drop down menu to be displayed that will show all the Excel files within the folder instead of having to minimize and manually search through it.

Also by the way- we're using Microsoft 2003.
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
This should work:

Code:
Private Sub Workbook_Open()

Dim fileList() As String
    Dim fName As String
    Dim fPath As String
    Dim I As Integer
    'define the directory to be searched for files
    fPath = "C:\temp\"
    
    'build a list of the files
    fName = Dir(fPath & "*.*")
    While fName <> ""
        'add fName to the list
        I = I + 1
        ReDim Preserve fileList(1 To I)
        fileList(I) = fName
        'get next filename
        fName = Dir()
    Wend
    'see if any files were found
    If I = 0 Then
        MsgBox "No files found"
        Exit Sub
    End If
    'cycle through the list and add to listbox
    For I = 1 To UBound(fileList)
    Sheet1.ComboBox1.AddItem fileList(I)
    Next

End Sub

Providing you have a combobox on sheet1.
 
Upvote 0

Forum statistics

Threads
1,224,825
Messages
6,181,190
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top