WBN.SaveAs "C:\Reports\" & ThisCust & ".xls" WBN.Close SaveChanges:=False


Set WSN = Nothing

Set WBN = Nothing

1 clear the output range, etc.

Cells(1, NextCol + 2).Resize(1, 10).EntireColumn.Clear Next cell

Cells(1, NextCol).EntireColumn.Clear MsgBox FinalCust - 1 & " Reports have been created!" End Sub

This is a remarkable 75 lines of code. Incorporating a couple of Advanced Filters and not much else,we've managed to produce a tool that created 27 reports in less than 1 minute (see Figure 11.20). Even an Excel power user would normally take 2-3 minutes per report to create these manually. In less than 60 seconds,this code easily will save someone a few hours every time these reports need to be created. Imagine the real scenario where there are hundreds of customers. I guarantee that there are people in every city who are manually creating these reports in Excel because they simply don't realize the power of Excel VBA.

Figure 11.20

White collar productivity would skyrocket if everyone knew how to create 27 reports in less than a minute.

0 0

Post a comment