SELECT A SPECIFIC WORKBOOK FROM A SPECIFIC FOLDER

choomkey

New Member
Joined
May 17, 2021
Messages
10
Office Version
  1. 365
Platform
  1. Windows
Please help
I am new to excel VBA and I cannot find an example online which solves my dilemma
I would like to press a button which will select a specific workbook from a specific folder
Before pressing the button I would like to use 3 dropdown boxes to select the specific work book name
Dropdown A=1-9, Dropdown B= 0-5, Dropdown C= 0-5
eg. the folder will contain ~324 workbooks with the file names in the following format - TGx yE zL where (x=1to9), (y=0to5), (z=0 to5)
many thanks in advance for your time
 
Last edited by a moderator:

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
Hi & welcome to MrExcel.
How about something like
VBA Code:
Sub choomkey()
   Dim Fname As String, Pth As String
   Pth = "C:\MrExcel\Fluff\"
   Fname = "TG" & Range("A2").Value & " " & Range("B2").Value & "E " & Range("C2").Value & "L.xlsx"
   Workbooks.Open Pth & Fname
End Sub
 
Upvote 0
Solution
Thankyou Fluff that worked perfectly. Much appreciated. If you don't mind and you have the time could you help me with another challenge.
The various workbooks (actually files containing one sheet) contain rows of numbers (each file has a different numbers of rows). Each row has 10 numbers which vary between (0- 80)
Once I have chosen the file path (A2,B2,C2) and before I press the button, I would like to also choose 2 numbers between (0-80) in cell D2 and E2, and display all the rows which contain those numbers.
many thanks for you help
 
Upvote 0
As that's a totaly different question, it needs a new thread. Thanks
 
Upvote 0

Forum statistics

Threads
1,215,514
Messages
6,125,265
Members
449,219
Latest member
daynle

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