Macro to build a database

EduPAz

Board Regular
Joined
Mar 18, 2017
Messages
69
Office Version
  1. 2019
  2. 2016
Platform
  1. Windows
Hi guys,

Can someone please can help me with this problem? I know it's a macro but I don't know how to start:


I have a folder called Data in this extension C:\Documents
There are 12 sub-folder (Jan, Feb, Mar,.., Dec) in the folder Data.
Every sub-folder (Jan, Feb, Mar,.., Dec) has 30 files (a1, a2, a3, a4, …a30)

I need to build a database (one tab) with the information from all the 30 files of every sub folder. In other words, I need to put the information of every single file (30*12) in one file.

Thanks in advance!!!

Edu
 
What kind of protected file?
-Need Password to Modif

Is the password the same for all files?

-Yes, it is.

Do you want to include the password in the code?

-Yes
 
Upvote 0

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
Add this before the Dim statements and put in the correct password
Code:
    Const sPassword As String = "password"

Change the open statement to:
Code:
    Workbooks.Open Filename:=sFilePathNameExt, ReadOnly:=True, Password:=sPassword
 
Upvote 0

Forum statistics

Threads
1,224,828
Messages
6,181,217
Members
453,024
Latest member
Wingit77

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