Solved

Prevent any cells being selected

Posted on 2014-02-05
2
208 Views
Last Modified: 2014-02-09
Hi

I noticed in vba within the sheets properties is a function which prevents any cells being selected if the sheet is locked, how can I enable this with a vba command?
0
Comment
Question by:DemonForce
2 Comments
 
LVL 80

Accepted Solution

by:
byundt earned 500 total points
ID: 39837898
The setting in the Properties for the worksheet doesn't accomplish anything until the worksheet is protected, as you have discovered.

In VBA, you would want to protect the worksheet first, then make the setting to prevent cell selection.
Sub NoSelection()
With Worksheets("Sheet1")
    .Protect
    .EnableSelection = xlNoSelection
End With
End Sub

Open in new window

0
 
LVL 29

Expert Comment

by:gowflow
ID: 39838274
@byundt thumbs up !!! nice one I didn't know about it very handy.
gowflow
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

MS Access 2003 or later To MySQL Migration Project Hello All, this is my second article in the category of MS-OFFICE Automation. In internet I am not able to find any comprehensive resource on the Migration of MS Access back-end to MySQL so I fin…
The new Microsoft OS looks great, is easier than ever to upgrade to, it is even free.  So what's the catch?  If you don't change the privacy settings, Microsoft will, in accordance with the (EULA) you clicked okay to without reading, collect all the…
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now