So I find myself doing development in Visual BASIC for Applications again. It’s central to all Microsoft Office applications. In essence it lets one perform conditional logic. Some of that functionality is already present in applications like Excel. As an example you can do IF tests, Data Lookups, etc. But it’s severely limited.
So I’m designing a spreadsheet with a dropdown box. In Excel 2007 if you just use the standard dropdown it won’t let you reference it in VBA.
Instead you have to use an Active-X dropdown box. Great.
Now I’ve always been able to basically say ‘a = dropbox1.value’ to get the selected value. But as I said, using the standard Excel dropdown resulted in the object not being accessible. Great.
But Active-X acts just like the old style. All I had to do is snag:
listItems = ListBox1.Value
And then do my case on istItems. Since I had configured the ListBox to be single selection and since there’s only one data field in it I didn’t have to sweep through it. Much easier.