Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 397
Default Finding out whats Protected...



Hi guys,

I got a sheet with some cells protected, and others not, how can I see
which are the cells that are protected..? (on screen..)

Also is it possible to write some VB, that will give me a list of all
protect cells for a given sheet...?

Thanks!!

Regards

D

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 110
Default Finding out whats Protected...

Hello Darin
In your worksheets, by design, all cells are locked so may be it would be
wiser to look for those which are NOT locked?
In which case may be something like this should help:
(amend sheet name accordingly and you will also need an additional worksheet
named "Analysis")
Sub TestIt()
Dim NbUnLckd As Long
NbUnLckd = 0
For Each c In Worksheets("Sheet1").Range("A1").CurrentRegion
If c.Locked = False Then
NbUnLckd = NbUnLckd + 1
Worksheets("analysis").Cells(NbUnLckd, 1).Value = c.Address
End If
Next c
End Sub

HTH
Cordially
Pascal


"Darin Kramer" a écrit dans le message de
...


Hi guys,

I got a sheet with some cells protected, and others not, how can I see
which are the cells that are protected..? (on screen..)

Also is it possible to write some VB, that will give me a list of all
protect cells for a given sheet...?

Thanks!!

Regards

D

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 397
Default Finding out whats Protected...


Thanks Pascal

Unfortunately, nothing happens when I run the macro :)
No error message even, and nothing on sheet Analysis


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 110
Default Finding out whats Protected...

Well then this means that all your cells are locked!
Cordially
Pascal

"Darin Kramer" a écrit dans le message de
...

Thanks Pascal

Unfortunately, nothing happens when I run the macro :)
No error message even, and nothing on sheet Analysis


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 397
Default Finding out whats Protected...



Thats just it, Not all the cells are locked.



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Finding out whats Protected...

This will highlight locked cells

Sub LockedCells()
Dim cell As Range
For Each cell In ActiveSheet.UsedRange
If cell.Locked Then
With cell
With .Interior
.ColorIndex = 35
.Pattern = xlSolid
End With
.BorderAround LineStyle:=xlDashDotDot, Weight:=xlThick,
ColorIndex:=5
End With
End If
Next cell
End Sub

Change
If cell.Locked Then
to
If Not cell.Locked Then
if you want to highlight non-locked cells.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Darin Kramer" wrote in message
...


Thats just it, Not all the cells are locked.



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



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
whats it do Curt Excel Discussion (Misc queries) 14 April 13th 07 07:53 PM
finding the password to unlock a protected cell/chart Pizza Charts and Charting in Excel 3 June 13th 06 01:17 PM
Whats the best way to... Azrael Excel Worksheet Functions 0 September 13th 05 04:51 AM
Whats the best way to... Azrael Excel Worksheet Functions 0 August 18th 05 05:33 AM
Whats the best way to... Azrael Excel Worksheet Functions 1 August 16th 05 09:01 PM


All times are GMT +1. The time now is 09:01 PM.

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"