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

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
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,223,911
Messages
6,175,334
Members
452,636
Latest member
laura12345

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