PC Review


Reply
Thread Tools Rate Thread

Can I lock only the cells containing formulas?

 
 
=?Utf-8?B?SmVubkxlZQ==?=
Guest
Posts: n/a
 
      19th Mar 2007
I desperately need to be able to lock cells containing formulas in the
worksheets to which the data is being captured via my custom UserForm (that's
housed on Sheet 1). I have to present my spreadsheet application to several
directors tomorrow and I really need to have this functionality in place! I
have several staff members that sometimes click into a cell after they've
entered their data and ACCIDENTLY erase the formula.
I've tried password protecting the sheets but them I get an error when
entering the data via the UserForm (which is coded to send data to lastrow
UNDER all my cells that contain the formulas. HELP PLEASE

Thanks in advance for any guidance,
--
Jennifer Lee
IS Coordinator/App Support
 
Reply With Quote
 
 
 
 
Gary Keramidas
Guest
Posts: n/a
 
      19th Mar 2007
maybe something like this:

sub lock_formulas
Dim cell As Range
Application.ScreenUpdating = False
ActiveSheet.Unprotect
For Each cell In Cells.SpecialCells(xlFormulas, 23)
cell.Locked = True
Next cell
end sub
--


Gary


"JennLee" <(E-Mail Removed)> wrote in message
news:F6743F58-DEB2-4F03-92F2-(E-Mail Removed)...
>I desperately need to be able to lock cells containing formulas in the
> worksheets to which the data is being captured via my custom UserForm (that's
> housed on Sheet 1). I have to present my spreadsheet application to several
> directors tomorrow and I really need to have this functionality in place! I
> have several staff members that sometimes click into a cell after they've
> entered their data and ACCIDENTLY erase the formula.
> I've tried password protecting the sheets but them I get an error when
> entering the data via the UserForm (which is coded to send data to lastrow
> UNDER all my cells that contain the formulas. HELP PLEASE
>
> Thanks in advance for any guidance,
> --
> Jennifer Lee
> IS Coordinator/App Support



 
Reply With Quote
 
Dave Peterson
Guest
Posts: n/a
 
      19th Mar 2007
Select your range to lock (include all the cells with the formulas -- and even
constants, too).

Edit|goto|Special
Select Formulas
and your range is now smaller
Format|cells|protection tab

and lock those cells with the formulas.

Make sure you unlock the cells that can be changed.

And then protect the worksheet.

JennLee wrote:
>
> I desperately need to be able to lock cells containing formulas in the
> worksheets to which the data is being captured via my custom UserForm (that's
> housed on Sheet 1). I have to present my spreadsheet application to several
> directors tomorrow and I really need to have this functionality in place! I
> have several staff members that sometimes click into a cell after they've
> entered their data and ACCIDENTLY erase the formula.
> I've tried password protecting the sheets but them I get an error when
> entering the data via the UserForm (which is coded to send data to lastrow
> UNDER all my cells that contain the formulas. HELP PLEASE
>
> Thanks in advance for any guidance,
> --
> Jennifer Lee
> IS Coordinator/App Support


--

Dave Peterson
 
Reply With Quote
 
George
Guest
Posts: n/a
 
      19th Mar 2007
On Mar 18, 7:18 pm, Dave Peterson <peter...@verizonXSPAM.net> wrote:
> Select your range to lock (include all the cells with the formulas -- and even
> constants, too).
>
> Edit|goto|Special
> Select Formulas
> and your range is now smaller
> Format|cells|protection tab
>
> and lock those cells with the formulas.
>
> Make sure you unlock the cells that can be changed.
>
> And then protect the worksheet.
>
>
>
>
>
> JennLee wrote:
>
> > I desperately need to be able to lock cells containing formulas in the
> > worksheets to which the data is being captured via my custom UserForm (that's
> > housed on Sheet 1). I have to present my spreadsheet application to several
> > directors tomorrow and I really need to have this functionality in place! I
> > have several staff members that sometimes click into a cell after they've
> > entered their data and ACCIDENTLY erase the formula.
> > I've tried password protecting the sheets but them I get an error when
> > entering the data via the UserForm (which is coded to send data to lastrow
> > UNDER all my cells that contain the formulas. HELP PLEASE

>
> > Thanks in advance for any guidance,
> > --
> > Jennifer Lee
> > IS Coordinator/App Support

>
> --
>
> Dave Peterson- Hide quoted text -
>
> - Show quoted text -


Easy:

Select the whole worksheet, then go to Format\Cells\Protection,
uncheck "Locked" box and click "Ok" button.

Follow what Dave wrote to lock cells with formulas and protect your
worksheet.

Done.

Thanks,

George

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
lock formulas in certain cells Gaba Microsoft Excel Programming 1 19th Oct 2009 07:06 PM
Lock and password protect only cells with formulas on all sheets in a workbook steve Microsoft Excel Programming 6 9th Jul 2006 06:36 PM
Hide formulas but not lock cells or contents Gunjani Microsoft Excel Discussion 2 16th Mar 2006 12:33 PM
Can u lock individual cells (those containing formulas) in an Exc. =?Utf-8?B?SlJhaW5lczEwMEBob3RtYWlsLmNvbQ==?= Microsoft Excel Misc 1 2nd Mar 2005 08:02 AM
Automatically lock cells and hide formulas =?Utf-8?B?UWFzcGVj?= Microsoft Excel Programming 4 14th Dec 2004 11:31 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:02 PM.