I'm using Excel VBA for the first time. Have used VBA with Access but a long time ago.
I want to do some complex validation of cell values, namely format (must be numeric), range (must be 1 - 50) and whether other cells have data in them. I know I can do the format/range validation in one step using Data Validation, but I don't see how to do the =AND for checking the other cells in addition to the first step. Therefore, my idea is to use VBA for the validation.
All of the cells that are unlocked for input have names. THe reason I think using the Name rather than the cell position is better in the VBA code is because the position of the cell might change as I add or delete things from the worksheet. EG, the name BR1_1 will always be in the worksheet, but although it refers to cell C18 right now, it could be C25 tomorrow.
So, I want to capture the name of the Target, not it's position in the worksheet. Using Target.name in VBA gives me Calculator!$c$18. I can loop through the Names in the worksheet and find BR1_1. How do I get the name of Calculator!$c$18?
Bookmarks