Can I prevent users selecting multiple cells?

  • Thread starter Thread starter Angus Comber
  • Start date Start date
A

Angus Comber

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
(e-mail address removed)
 
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.
 
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 (e-mail address removed)
 
Try menu
tools/options/
and uncheck "row and column headers" under the view tab

Tony.
 
Back
Top