Question: We work with subcontractors who have insurance certificates that expire at various dates. We store these certificates and expiry dates in Excel. Is there a way in Excel to warn me when a particular certificate is about to expire? Answer: There are several "events" available within an Excel spreadsheet where you can place VBA code. In your case, we want to place our code in the "Workbook_Open" event. Let's take a look at an example. Download Excel spreadsheet (as demonstrated below)
|
In our spreadsheet, there is a sheet called Sheet1. In column C, we store the expiry date for each insurance certificate. When the Excel file is opened, the VBA code on the "Workbook_Open" event automatically runs to check the first 200 rows in this spreadsheet. Each row is checked to see if the certificate will expire in the next 31 days. In our example, we've opened the file on Sept 1, 2003. In this case, we will get the following warning message:
|
The macro will generate one warning message for each certificate that will expiry within the next 31 days. You can press Alt-F11 to view the VBA code. Macro Code:The macro code looks like this:
|
Visit our busy book shop, were you can find latest books for beginners as well as advanced excel users.
Spreadsheet 123 Spreadsheet Software Development
See Spreadsheets for:
a.Hotel Management b.Personal Budget
c.Corporate Finance d.Rating Calculation e.Real Estate and Mortgage
f.Web Calc