(Fletch) wrote:
: Any thoughts on how to validate an Excel range with RegEx?
: Acceptable inputs would include $A1:$BD25, C:C, B4 etc.
: I'm close to coming up with an answer but I'm not sure how to stop
: invalid range references such as C3:A2 from being accepted.
What makes "C3:A2" an invalid range specification? Excel accepts it
without any complaint.
A set of row/column adresses is not the only way to specify a range.
Range("foo") is perfectly acceptable syntax for referring to a named range.
Validating the argument with a regex is fine if you want to impose
arbitrary restrictions on its format. You first need to decide exactly
what formats are valid, which means "etc." is right out.
If you simply want to catch arguments that will make Excel puke, you're
better off not wanting that. Just use the argument as it is and trap
errors thrown by Excel.