Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 20th, 2008, 01:22 AM
Registered User
 
Join Date: Mar 2008
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Disabling copy function for selected cells

I have an excel sheet (scoring sheet) in which most of the cells as
protected except one column, which requires users to input the scores. There three type of scoring categories allowed (as per drop don list given by me). I want to disable copying / dragging of data from one cell to another so that the type of scoring as applicable to a particular dosen't get altered.

 
Old March 20th, 2008, 06:15 AM
Friend of Wrox
 
Join Date: Sep 2005
Posts: 812
Thanks: 1
Thanked 53 Times in 49 Posts
Default

You can disable drag & drop of cell contents:

Sub Disable_Cell_Drag_Drop()

Application.CellDragAndDrop = False

End Sub

Cheers
Shasur

http://www.dotnetdud.blogspot.com

VBA Tips & Tricks (http://www.vbadud.blogspot.com)
 
Old March 20th, 2008, 06:35 AM
Registered User
 
Join Date: Mar 2008
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks Shasur,

Actually my requirements are a bit more than this. Will try & list them down:

1) For particular range of cells, user should be able to input only value provided in the drop down list, and
2) User should not be able to copy (^C), cut (^X), paste (^V), fill (^D) either by using shortcut keys or toolbars or right click menus.
3) User should not be able to access the VB code so that macros cannot be altered.
4) All the above functions should be applicable to the required workbook / worksheet only.
5) How to undo all the able commands.

..... A bit lenthy one.

Once again thanks for yr response.... Hope to hear soon from u.

 
Old March 21st, 2008, 04:01 AM
Friend of Wrox
 
Join Date: Sep 2005
Posts: 812
Thanks: 1
Thanked 53 Times in 49 Posts
Default

You can disable the Keys by using the Application.Key :

http://vbadud.blogspot.com/2007/06/a...el-macros.html

You can also disable the shortcut keys

http://vbadud.blogspot.com/2007/04/d...ght-click.html


Protecting the project (Tools--> Project Properties-->Protection--> Enable Lock Project For Viewing would help you for resticting access

Cheers
Shasur


http://www.dotnetdud.blogspot.com

VBA Tips & Tricks (http://www.vbadud.blogspot.com)





Similar Threads
Thread Thread Starter Forum Replies Last Post
disabling copy-paste for a textbox control gaikwad.ganesh C# 3 October 21st, 2008 03:41 PM
Copy visible cells paul20091968 Excel VBA 2 January 3rd, 2007 11:43 PM
Copy cells from an excel file opened in a browser escorido Excel VBA 0 July 6th, 2004 01:44 AM
Disabling copy/paste in both IE & Netscape Mekala HTML Code Clinic 0 July 2nd, 2004 04:24 AM
excel: Extracting only selected cells. rachelrekkab Excel VBA 5 July 22nd, 2003 12:55 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.