Data Compilation Time Reduction Using VBA
Most of the time data is gathered from various Sub-divisions, compiled by Divisions, then by Circle offices, Region offices, and finally by Mantralaya.
Google Sheets is a good option, but internet connectivity issues and large file sizes can sometimes create problems.
Since the format is generally kept the same, copy-paste seems like a simple solution — but as we all know, it often consumes a huge amount of time.
Here I have tried to automate this process using VBA.
Demo Video
Here is a short demonstration of how it works:
VBA Script
The following VBA code performs the automation shown in the video. It can be further modified as per your specific requirements.
Features of this script:
- Opens all Excel files in a specified folder
- Reads the required data from each file (currently Sheet 4, rows 1–50, columns 1–20)
- Saves the data in memory (array)
- Closes each file without saving changes
- After processing all files, writes the collected data to the master workbook
Note: Place all source Excel files in a sub-folder named "Files" in the same directory as this macro workbook.
You can adjust the sheet number, row/column ranges, and array sizes according to your actual data structure.
0 Comments
If you have any doubts, suggestions , corrections etc. let me know