View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default Can I prevent users selecting multiple cells?

Just to keep the macro code "healthy, well-written, and adored", you might
want to disable events in the macro. E.g.,

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Application.EnableEvents = False
Target(1).Select
Application.EnableEvents = True
End Sub


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com

"Harald Staff" wrote in message
...
Hi Angus

A macro can do everything. So assuming macros are enabled, running,

healthy, well written
and adored. Rightclick the sheet tab, choose "View code", paste this in:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Target(1).Select
End Sub

... but it is not a nice thing to do. Nothing "overriding" is.

--
HTH. Best wishes Harald
Followup to newsgroup only please.

"Angus Comber" wrote in message
...
Hello

If a user ttempts to select multiple cells or clicks on the top left to
select all rows I want to just select the top left cell in the

selection -
overriding Excels usual behaviour. Can I do this? Please let me know

how?

Angus Comber