Troublesome tester- Is clicking top left select all...how to codetrap this?

G

Ggalla1779

Hi all

How do I trap or stop user from clicking top left ...ie all cells

As it causes error on worksheet and stops all macros/ code running

Error message Application-defined or object-defined error (1004)

regards

George
 
A

Auric__

Ggalla1779 said:
How do I trap or stop user from clicking top left ...ie all cells

As it causes error on worksheet and stops all macros/ code running

Error message Application-defined or object-defined error (1004)

You're solving the wrong problem. Rather than prevent the users from
selecting everything, why not try to figure out what's causing the error in
the first place?
 
G

Ggalla1779

aha so grass hopper...DeNada is born

'Calling
If NamedRngIsDeNada("myRange") Then
Application.EnableEvents = True
Exit Sub
End If

Function NamedRngIsDeNada(sName As String) As Boolean
' Test for cleared Named Range
On Error Resume Next

NamedRngIsDeNada = Range(sName).Count <> 0
NamedRngIsDeNada = Not NamedRngIsDeNada
Err.Clear
End Function
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top