Disable Cell Selection

gjadcock

New Member
Joined
Sep 17, 2002
Messages
27
I have written an application to search and sort data, my first sheet is the query window, is there any way to prevent the user selecting the cells in this sheet.
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
the easiest way is to right click the upper left hand corner (the select sheet area), select format cells, select protection, and select locked. then goto tools, protection and protect the sheet. this will prevent the user from being able to change anything on the sheet.
 
Upvote 0
Thanks, but thats not really what Im looking for. I want to completley disable the cell selection i.e. if the user clicks out of the query text boxes into the background worksheet, no cells are selected/highlighted
 
Upvote 0
With the Tools>Protection>Protect Sheet Option you can turn off 'Select Locked Cells' and 'Select Unlocked Cells' so that nothing should be selected if your user clicks on the background.
 
Upvote 0
Is this option available under 2000?

If I go to TOOLS > PROTECTION > PROTECT SHEET I get 3 tick boxes to select what is protected (Contents, objects, scenarios) and a pwd box??

Am I looking in the correct place?
 
Upvote 0
In the WorkSheet module

<font face=Courier New><SPAN style="color:darkblue">Private</SPAN> <SPAN style="color:darkblue">Sub</SPAN> Worksheet_SelectionChange(<SPAN style="color:darkblue">ByVal</SPAN> Target <SPAN style="color:darkblue">As</SPAN> Range)
    <SPAN style="color:darkblue">If</SPAN> Target.Address = "$A$1" <SPAN style="color:darkblue">Then</SPAN> <SPAN style="color:darkblue">Exit</SPAN> <SPAN style="color:darkblue">Sub</SPAN>
    Range("$A$1").<SPAN style="color:darkblue">Select</SPAN>
<SPAN style="color:darkblue">End</SPAN> <SPAN style="color:darkblue">Sub</SPAN></FONT>
 
Upvote 0
Excelent, worked like a dream, except I replaced the

Range("$A$1").Select

with

bldg_code_entry.Activate

to keep the text box live

Can you stop the border appearing temporarily around the cell?

:wink:
 
Upvote 0

Forum statistics

Threads
1,215,049
Messages
6,122,864
Members
449,097
Latest member
dbomb1414

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top