Ark68
Well-known Member
- Joined
- Mar 23, 2004
- Messages
- 4,564
- Office Version
- 365
- 2016
- Platform
- Windows
I'm hoping someone is able to relate to an issue I am having, and be able to provide some sort of advice, direction etc. It's not a major project halting problem, nor is it creating an error, but it is an inconvenience.
On my worksheet, I have a merged cell (B6), merging range B6:F6. This "cell" has data verification, associated to it, a list. The dropdown arrow sits nicely to the right edge of the merged cell (at F6), and fits the contents nicely when a value is selected. The issue I am having is with the error handling of an inappropriate value entered into the cell that data validation captures. I am unable to create a custom error message through the data validation. When I try, I am given the message "The selection contains more than one type of validation. Erase current setting and continue?". Of course, I have to decline that.
No, yes ... merged cells bad! I know. I suspect that the data validation is being applied to each cell of the range of the merged area.
But I don't know a workaround, so here I am. I have been trying to work with CenterAcrossSelection, which really only formats the value across the range. I can only apply data validation to the one cell, leaving the other 4 cells vulnerable to access without data validation. The dropdown arrow is beside B6, so not representative of the broader range. If I move the data validation to F6, the dropdown arrow is outside the cell to the right, but now the values in the list are illegible because the column is too narrow. Also, that option requires the user to click on F6 to get the values. They can still inappropriately enter data on one of the other 4 cells that form that user entry field.
With the merged cell option, it is more user friendly, but it results in the default error box, with the retry, cancel and help buttons. Retry is functional, cancel takes me to a point in my code that causes an error (I would have to adapt code to handle it at that point but don't know how to identify that the cancel button of the default box was clicked), and help is useless other than bringing up generic Office Help.
I could add code to B6 change event to trap any unwanted value, but how do I prevent the default data validation error box from interrupting?
What do you pros suggest as a workaround or what option do you think is reasonable?
On my worksheet, I have a merged cell (B6), merging range B6:F6. This "cell" has data verification, associated to it, a list. The dropdown arrow sits nicely to the right edge of the merged cell (at F6), and fits the contents nicely when a value is selected. The issue I am having is with the error handling of an inappropriate value entered into the cell that data validation captures. I am unable to create a custom error message through the data validation. When I try, I am given the message "The selection contains more than one type of validation. Erase current setting and continue?". Of course, I have to decline that.
No, yes ... merged cells bad! I know. I suspect that the data validation is being applied to each cell of the range of the merged area.
But I don't know a workaround, so here I am. I have been trying to work with CenterAcrossSelection, which really only formats the value across the range. I can only apply data validation to the one cell, leaving the other 4 cells vulnerable to access without data validation. The dropdown arrow is beside B6, so not representative of the broader range. If I move the data validation to F6, the dropdown arrow is outside the cell to the right, but now the values in the list are illegible because the column is too narrow. Also, that option requires the user to click on F6 to get the values. They can still inappropriately enter data on one of the other 4 cells that form that user entry field.
With the merged cell option, it is more user friendly, but it results in the default error box, with the retry, cancel and help buttons. Retry is functional, cancel takes me to a point in my code that causes an error (I would have to adapt code to handle it at that point but don't know how to identify that the cancel button of the default box was clicked), and help is useless other than bringing up generic Office Help.
I could add code to B6 change event to trap any unwanted value, but how do I prevent the default data validation error box from interrupting?
What do you pros suggest as a workaround or what option do you think is reasonable?