ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Troublesome tester- Is clicking top left select all...how to codetrap this? (https://www.excelbanter.com/excel-programming/446446-troublesome-tester-clicking-top-left-select-all-how-codetrap.html)

Ggalla1779

Troublesome tester- Is clicking top left select all...how to codetrap this?
 
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

Auric__

Troublesome tester- Is clicking top left select all...how to code trap this?
 
Ggalla1779 wrote:

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?

--
I've come to realize tonight, my friend, the end of time is not so far away.
We cannot pray to save our lives.

Ggalla1779

Troublesome tester- Is clicking top left select all...how to codetrap this?
 
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



All times are GMT +1. The time now is 11:23 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com