Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Disable selection on a new workbook remotely? | Excel Programming | |||
need code for disable selection of locked cells | Excel Programming | |||
Disable menu selection | Excel Discussion (Misc queries) | |||
Excel VBA - Range(Selection, Selection.End(xlDown)).Name issue. | Excel Programming | |||
Disable selection of shapes | Excel Programming |