B
big t
Hi everyone,
I'm using the following code to check a range exists on a worksheet:
Public Function RangeExists(rangeName As String) As Boolean
Dim var As Variant
RangeExists = False
On Error GoTo BadRange
If rangeName <> "" Then
var = Range(rangeName)
RangeExists = True 'will raise error where range does not exist
'therefore to get here, it must
Exit Function
End If
BadRange:
End Function
and it works fine. The trouble is I call this function about 34000 times and
it takes approx 14 seconds to run.
Any ideas for a faster way to check a range exists?
TIA
big t
I'm using the following code to check a range exists on a worksheet:
Public Function RangeExists(rangeName As String) As Boolean
Dim var As Variant
RangeExists = False
On Error GoTo BadRange
If rangeName <> "" Then
var = Range(rangeName)
RangeExists = True 'will raise error where range does not exist
'therefore to get here, it must
Exit Function
End If
BadRange:
End Function
and it works fine. The trouble is I call this function about 34000 times and
it takes approx 14 seconds to run.
Any ideas for a faster way to check a range exists?
TIA
big t