Data Automation with Excel

Automate repetitive tasks with VBA macros and advanced formulas. Save hours of manual work every week.

πŸ“‚

Auto-Import CSV Files

Automatically import and process CSV files from a folder

VBA Code:

Sub ImportAllCSV() Dim folderPath As String Dim fileName As String Dim ws As Worksheet folderPath = "C:\Data\" fileName = Dir(folderPath & "*.csv") Do While fileName <> "" Set ws = Sheets.Add ws.Name = Left(fileName, Len(fileName) - 4) With ws.QueryTables.Add( _ Connection:="TEXT;" & folderPath & fileName, _ Destination:=ws.Range("A1")) .TextFileParseType = xlDelimited .TextFileCommaDelimiter = True .Refresh BackgroundQuery:=False End With fileName = Dir() Loop End Sub

What It Does:

  • Scans a folder for all CSV files
  • Creates a new sheet for each file
  • Imports data automatically with proper formatting
  • Handles multiple files in one click
πŸ“Š

Auto-Generate Monthly Reports

Create formatted reports with charts and summaries automatically

VBA Code:

Sub GenerateMonthlyReport() Dim reportWs As Worksheet Dim dataWs As Worksheet Dim lastRow As Long Set dataWs = Sheets("RawData") Set reportWs = Sheets.Add reportWs.Name = "Report_" & Format(Date, "mmm_yyyy") ' Add headers With reportWs .Range("A1").Value = "Monthly Sales Report" .Range("A1").Font.Size = 16 .Range("A1").Font.Bold = True ' Calculate totals lastRow = dataWs.Cells(Rows.Count, 1).End(xlUp).Row .Range("A3").Value = "Total Sales:" .Range("B3").Formula = "=SUM(RawData!D2:D" & lastRow & ")" .Range("A4").Value = "Average Deal:" .Range("B4").Formula = "=AVERAGE(RawData!D2:D" & lastRow & ")" ' Format as currency .Range("B3:B4").NumberFormat = "$#,##0.00" End With MsgBox "Report generated successfully!" End Sub

What It Does:

  • Creates a new report sheet with current month name
  • Calculates total sales and averages automatically
  • Applies professional formatting
  • Can be scheduled to run automatically
πŸ“§

Auto-Send Email Reports

Automatically email reports to stakeholders with attachments

VBA Code:

Sub EmailReport() Dim OutApp As Object Dim OutMail As Object Dim filePath As String ' Save workbook ThisWorkbook.Save filePath = ThisWorkbook.FullName ' Create email Set OutApp = CreateObject("Outlook.Application") Set OutMail = OutApp.CreateItem(0) With OutMail .To = "manager@company.com" .CC = "team@company.com" .Subject = "Monthly Report - " & Format(Date, "mmmm yyyy") .Body = "Please find attached the monthly sales report." & vbCrLf & vbCrLf & _ "Summary:" & vbCrLf & _ "Total Sales: " & Format(Sheets("Report").Range("B3").Value, "$#,##0.00") .Attachments.Add filePath .Send ' Use .Display to review before sending End With Set OutMail = Nothing Set OutApp = Nothing End Sub

What It Does:

  • Creates a professional email with report summary
  • Attaches the Excel file automatically
  • Sends to multiple recipients (To and CC)
  • Can be triggered manually or scheduled with Windows Task Scheduler
⚑

Dynamic Data Processing

Process and transform data with advanced array formulas

Formula:

=FILTER(Data, (Data[Status]="Active") * (Data[Revenue]>=10000))

What It Does:

This dynamic array formula automatically filters your data to show only active accounts with revenue of $10,000 or more. The results update automatically when your source data changes - no VBA needed! Perfect for creating live dashboards and reports.

Need Custom Automation?

Our AI can generate VBA macros and automation formulas tailored to your specific workflow.