Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default disable range selection

Hi,
I would like to disable a user's ability to select ranges. I want to
restrict the user to selecting only one cell at a time in certain
worksheets. Is this possible?

Thanks,
Bob

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default disable range selection

'-----------------------------------------------------------------
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
'-----------------------------------------------------------------

On Error GoTo ws_exit:
Application.EnableEvents = False
If Target.Count 1 Then Target.Cells(1, 1).Select
ws_exit:
Application.EnableEvents = True
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.





--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

wrote in message
ps.com...
Hi,
I would like to disable a user's ability to select ranges. I want to
restrict the user to selecting only one cell at a time in certain
worksheets. Is this possible?

Thanks,
Bob



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default disable range selection

Great, thanks!

Bob Phillips wrote:
'-----------------------------------------------------------------
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
'-----------------------------------------------------------------

On Error GoTo ws_exit:
Application.EnableEvents = False
If Target.Count 1 Then Target.Cells(1, 1).Select
ws_exit:
Application.EnableEvents = True
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.





--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

wrote in message
ps.com...
Hi,
I would like to disable a user's ability to select ranges. I want to
restrict the user to selecting only one cell at a time in certain
worksheets. Is this possible?

Thanks,
Bob


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Disable selection on a new workbook remotely? Jon[_21_] Excel Programming 1 November 25th 05 08:36 PM
need code for disable selection of locked cells David Lewis[_3_] Excel Programming 4 January 10th 05 04:09 PM
Disable menu selection andy Excel Discussion (Misc queries) 3 December 10th 04 10:46 PM
Excel VBA - Range(Selection, Selection.End(xlDown)).Name issue. jonH Excel Programming 3 June 7th 04 09:13 PM
Disable selection of shapes Mike Excel Programming 3 December 17th 03 01:43 PM


All times are GMT +1. The time now is 09:59 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"