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 April 1st, 2005, 06:54 AM
Registered User
 
Join Date: Mar 2005
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to lock particular cell for being edited


I want to lock perticular cell in excel form being edited.
Can I do it.
If yes then how?

 
Old April 1st, 2005, 07:03 AM
Friend of Wrox
 
Join Date: Jan 2005
Posts: 180
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Do you mean a cell in a worksheet or do you mean a textbox in a form?

 
Old April 1st, 2005, 11:10 AM
Registered User
 
Join Date: Mar 2005
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default


I mean cell in a worksheet

 
Old April 6th, 2005, 11:19 AM
Registered User
 
Join Date: Mar 2005
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I'm not sure if you want to do this from code or from Excel but as this is a VBA forum lets assume it is code. In that case select the cell tou want to lock and the following 2 lines of code should do the trick

    Selection.Locked = True
    ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True

If you want to do it from Excel just lock the cell using the menu Format|Cells... then select the Protection tab and ensure the Locked tickbox is checked. Then use the Tools|Protection|Protect Sheet... menu to protect the sheet and any locked cells will be locked against alteration.

Cheers
nic

 
Old August 4th, 2006, 04:43 AM
Authorized User
 
Join Date: Mar 2006
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Default


Hey Nic,

Thanks again from me; as this was driving me mad yesterday! So I come to the forum and here is the exact answer I was looking for!

Where can you find documentation about excel spreadsheet object properties anyway???

There is nothing like this in the Excel help and on-line links.

Cheers, Joel :D
 
Old August 6th, 2006, 09:40 PM
Registered User
 
Join Date: Jul 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi
 I want to lock perticular cell in excel form Java Programme.Anybody any idea..Let me know...Very urgent to me

Thank U
  Giri



 
Old August 8th, 2006, 08:43 PM
Registered User
 
Join Date: Jul 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi
 I want to lock perticular cell in excel form Java Programme.Anyone have idea..Let me know...Very urgent to me

Thank U
  Giri



 
Old October 17th, 2006, 11:07 PM
Registered User
 
Join Date: Jul 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Sunil
  This IS Giri From Malaysia.i Need ur Help.I want to lock Exel Sheet or cell.Iam using RAD.Do u have any idea......My id is [email protected] Help me


Quote:
quote:Originally posted by sunil menghani


I want to lock perticular cell in excel form being edited.
Can I do it.
If yes then how?






Similar Threads
Thread Thread Starter Forum Replies Last Post
cell is empty while using For Each cell In Range jase2007 Excel VBA 4 April 5th, 2012 10:20 PM
Separating a CSV cell into 1 value per cell bigtonyicu Excel VBA 2 March 14th, 2008 12:28 PM
I need to refer a cell within a cell like =RC[ RC2 chakravarthi_os Excel VBA 1 September 24th, 2006 08:19 AM
if the cell content is a part of another cell cont sriramus Excel VBA 1 November 15th, 2005 10:20 AM
Lose cell Text when editing cell in VSFlexGrid 6 bobcratchet VB How-To 0 July 30th, 2004 09:32 AM





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