|
|
Question : Check if cell text is a valid address
|
|
Say for example I have a cell that contains text 'C15'. This text is suppose to be a cell address. How can I validate that the text in that cell is a valid Excel cell location in a VB subroutine? In other words if the cell contains '15C' I would like to be able to detect that as an error. Is there a function to validate text as a valid address?
|
Answer : Check if cell text is a valid address
|
|
Hi rdclk23, The following function returns True if the cell contains a valid address. Function TestAddress(cel As Range) As Boolean Dim rg As Range On Error Resume Next Set rg = Range(cel.Value) TestAddress = Not rg Is Nothing On Error GoTo 0 End Function
Cheers! Brad
|
|
|
|