Welcome to the Excel Data Extractor system by EslamHub! π
This project provides a smart, reusable Excel tool for extracting filtered data from any table inside Excel files (local or external), using built-in VBA macros and a friendly interface.
- π DataExtractor.xlsm: The main Excel file for data extraction.
- π» VBA Module: Includes code for importing filtered data and clearing previous results.
- βοΈ Helper Functions:
GetWorkbookPath()andGetSheetName()to simplify setup.
The system uses AdvancedFilter to extract rows from any source table based on your criteria and outputs only selected columns.
| Cell | Purpose |
|---|---|
B1 |
File path of source workbook (=GetWorkbookPath() for current file) |
B2 |
Sheet name in source workbook (=GetSheetName() for the first sheet) |
B3 |
Starting cell of the source table (e.g., A2) |
Make sure these three inputs are correct and point to a valid range. If any of them are incorrect or missing, the extraction will fail.
| Row | Description |
|---|---|
| Row 1 | Column headers to match (e.g., Invoice Date, Customer) |
| Row 2 | Filtering criteria (e.g., >=45818, =Youssef) |
| Row 4 | Output headers (the columns you want to extract from the source) |
You can pull any combination of columns by simply typing their header names in Row 4. These must exactly match the headers in the source table.
- β Get: Imports the filtered data based on your conditions.
- β Clear: Deletes the previously imported data from the result sheet.
| Invoice Date | Customer |
|---|---|
>=45818 |
Youssef |
Invoice Date, Invoice No, Customer, Product, Quantity, Total
- Sales reports
- Filtering employee data
- Extracting product lists
- Custom reporting systems
ImportFilteredData()β Main extraction macroClearImportedData()β Clears resultsGetWorkbookPath()β Returns current workbook pathGetSheetName()β Returns the name of the first sheet
- Ensure the source file exists and is accessible
- Sheet name and start cell must be correct
- Row 4 headers must exactly match those in the source table
- Criteria can include:
=value>=value,<=value- Wildcards like
*text*
- Go to the
Configsheet- Enter the source file path (or use
=GetWorkbookPath()) - Enter the sheet name (or use
=GetSheetName()) - Set the top-left cell of your data table (e.g.,
A2)
- Enter the source file path (or use
- Go to the
Resultsheet- Fill Row 1 with headers to filter
- Fill Row 2 with criteria
- Fill Row 4 with headers to extract
- Click the Get button
- To remove results, click Clear
πΊ YouTube π± TikTok πΌ LinkedIn π¦ X π Facebook πΈ Instagram
#Excel #VBA #DataExtraction #EslamHub