Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Validate Excel Range with RegEx
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. Thanks. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Validate Excel Range with RegEx
You could try something like this. But be aware that "C3:A2" is a perfectly
valid range string. Even thought Excel will turn it around for presentation/display purposes that doesn't mean it's invalid. Sub Test() MsgBox RgValid("ZC3:A2") End Sub Function RgValid(RgStr) As Boolean Dim Rg As Range On Error GoTo ExitThis Set Rg = Range(RgStr) RgValid = True Exit Function ExitThis: End Function -- Jim Rech Excel MVP |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
automated cut and paste using regex | Excel Worksheet Functions | |||
validate a date range | Excel Discussion (Misc queries) | |||
Validate date within range prior to calculation | Excel Discussion (Misc queries) | |||
Regex Question | Excel Programming | |||
regex string matching | Excel Programming |