Archive for the ‘Events’ Category.

Preventing auto_open and Workbook_Open events from running

As a fulltime developer I oftentimes open files containing VBA and want to be able to run code. At the same time I sometimes want to prevent Workbook_Open event code or an Auto_Open macro from running.
With Excel 97 to 2003, this was simple: hold the shift key when you click “Enable macros”.
With Excel 2007 and [...]

Previous Sheets Stack

I have a workbook with 131 worksheets in it (one for each inventory item). It is a terrible design, but it’s a non-trivial task to make it right, so I haven’t done it yet. Instead, I’m making little macros to make working in this monstrosity livable. I have a macro to build [...]

UK Excel User Conference

A meeting of the above group will take place on Wednesday 1st and Thursday 2nd April 2009 in London. This FREE event has some fantastic speakers from the Excel community.
The agenda for the two days is outlined below and you can book for either or both days by emailing bookings@excelusergroup.org.
Microsoft will be providing the venue [...]

Double Clicking Through a List

I have a cell with data validation. It’s set as an in-cell dropdown list and contains two items: Yes and No. I want to make it so that I can double click on that cell to toggle between yes and no. But wait, that’s not good enough. What about longer lists? [...]

Catching Paste Operations

You know the situation: You have carefully setup a workbook with intricate Validation schemes. But then along comes your user and he copies and pastes at will. Result: Validation zapped, workbook structure violated.
What to do? The only way I find to be reliable is to catch all possible paste operations. But this isn’t very easy, [...]

Double Click to Exclude Numbers

I have a table of numbers and formulas for each row, column, and for the table as a whole. The table is part of a report - the output of the application. The user wants to exclude certain numbers from the calculations after reviewing them. These numbers would be outliers and would [...]

Combobox Events in an Add-in

I have an application that displays a list of “documents” for a particular product. Most of the documents are pdfs, but some are iso images for burning a CD. The display sheet shows each CD associated with the product, and for each CD the iso, the label that’s stuck to the CD, and [...]

Capture Deleted Rows

Excel doesn’t provide events for the deletion of rows and columns. There are two methods that you can use to determine if a user deletes a row, and they are described here. If you want to detect column deletion, the process is the same, but some of the details change.
Monitored Public Variable
The first [...]