Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old April 1st, 2005, 05:54 AM
Registered User
 
Join Date: Mar 2005
Location: jaipur, rajasthan, India.
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?

__________________
Sunil
Reply With Quote
  #2 (permalink)  
Old April 1st, 2005, 06:03 AM
Friend of Wrox
 
Join Date: Jan 2005
Location: Bournemouth, Dorset, United Kingdom.
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?

Reply With Quote
  #3 (permalink)  
Old April 1st, 2005, 10:10 AM
Registered User
 
Join Date: Mar 2005
Location: jaipur, rajasthan, India.
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default


I mean cell in a worksheet

Reply With Quote
  #4 (permalink)  
Old April 6th, 2005, 11:19 AM
Registered User
 
Join Date: Mar 2005
Location: Johannesburg, , South Africa.
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

Reply With Quote
  #5 (permalink)  
Old August 4th, 2006, 04:43 AM
Authorized User
 
Join Date: Mar 2006
Location: Aberdeen, Scotland, United Kingdom.
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
Reply With Quote
  #6 (permalink)  
Old August 6th, 2006, 09:40 PM
Registered User
 
Join Date: Jul 2006
Location: , , .
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



Reply With Quote
  #7 (permalink)  
Old August 8th, 2006, 08:43 PM
Registered User
 
Join Date: Jul 2006
Location: , , .
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



Reply With Quote
  #8 (permalink)  
Old October 17th, 2006, 11:07 PM
Registered User
 
Join Date: Jul 2006
Location: , , .
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 borugadda007@yahoo.com.Plz 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?

Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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 09:20 AM
Lose cell Text when editing cell in VSFlexGrid 6 bobcratchet VB How-To 0 July 30th, 2004 09:32 AM



All times are GMT -4. The time now is 02:47 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.