Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 36
Default Cell Protection vs. Worksheet Protection

Is there anyway to protect selected cells from editing without having to
protect the entire worksheet? I know that I can lock or unlock certain cells
when I protect the worksheet as a whole, but when I use worksheet protection,
it interferes with some of my code and user functionality.... Please
advise...

Thanks,

Kevin
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,073
Default Cell Protection vs. Worksheet Protection


kmwhitt wrote:
Is there anyway to protect selected cells from editing without having to
protect the entire worksheet? I know that I can lock or unlock certain cells
when I protect the worksheet as a whole, but when I use worksheet protection,
it interferes with some of my code and user functionality.... Please
advise...

Thanks,

Kevin


Hi Kevin,

Change your code so that it unprotects the sheet, makes its changes,
then protects the sheet.

Eg...

Public Sub CodeForProtection()
With Sheet1
..Unprotect "ken"
..Range("A1").Value = 1
..Protect "ken"
End With
End Sub

If you are not using a password then you just use .Unprotect and
..Protect on their own.

Ken Johnson

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 268
Default Cell Protection vs. Worksheet Protection

That's the only way! However, macros can also unprotect and reprotect your
worksheet.

"kmwhitt" wrote:

Is there anyway to protect selected cells from editing without having to
protect the entire worksheet? I know that I can lock or unlock certain cells
when I protect the worksheet as a whole, but when I use worksheet protection,
it interferes with some of my code and user functionality.... Please
advise...

Thanks,

Kevin

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Cell Protection vs. Worksheet Protection

Depending on what your code does, you can protect the worksheet in code.

Option Explicit
Sub auto_open()
With Worksheets("sheet1")
.Protect Password:="hi", userinterfaceonly:=True
End With
End Sub

The userinterfaceonly means that you're stopping the user from changing locked
cells on a protected worksheet (Sheet1, in my example). But your code can
change things that the user can't.

But do some testing. There are a few things that still need you to unprotect
the worksheet, do your stuff, and protect the worksheet. (But maybe you're not
doing one of those few things.)

kmwhitt wrote:

Is there anyway to protect selected cells from editing without having to
protect the entire worksheet? I know that I can lock or unlock certain cells
when I protect the worksheet as a whole, but when I use worksheet protection,
it interferes with some of my code and user functionality.... Please
advise...

Thanks,

Kevin


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 36
Default Cell Protection vs. Worksheet Protection

Thanks for all your help, guys!

"kmwhitt" wrote:

Is there anyway to protect selected cells from editing without having to
protect the entire worksheet? I know that I can lock or unlock certain cells
when I protect the worksheet as a whole, but when I use worksheet protection,
it interferes with some of my code and user functionality.... Please
advise...

Thanks,

Kevin

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How:Add New Worksheet that copies the cell of the previous sheet JLM Excel Worksheet Functions 1 August 24th 06 08:04 PM
link worksheet A & B garyww Excel Worksheet Functions 2 August 19th 06 04:07 AM
Using cell content to access another worksheet in same workbook ScubaBum Excel Worksheet Functions 5 June 28th 06 11:11 PM
Adding a row to worksheet does not update cell references in another. blausen Excel Worksheet Functions 5 February 25th 06 09:14 PM
Possible Lookup Table Karen Excel Worksheet Functions 5 June 8th 05 09:43 PM


All times are GMT +1. The time now is 02:10 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"