View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jim Rech Jim Rech is offline
external usenet poster
 
Posts: 2,718
Default 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