Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Lock/Unlock cells
Is there a way to "preview" the locked/unlocked cells in worksheet?
|
#2
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Lock/Unlock cells
BFife, this macro may help, will select the lock or unlocked cells in the
selection Sub SelectedLockedUnlockedCells() 'will select the locked or unlocked cells in the selection Dim myCell As Range Dim myRange As Range Dim SelLocked As Boolean Dim myReply As Variant myReply = MsgBox("Select Locked = ""Yes""" & Chr(10) & _ "Select UnLocked = ""No""", vbYesNoCancel) If myReply = vbCancel Then Exit Sub For Each myCell In Selection If myReply = vbYes And myCell.Locked Then If myRange Is Nothing Then Set myRange = myCell Else Set myRange = Union(myRange, myCell) End If End If If myReply = vbNo And Not myCell.Locked Then If myRange Is Nothing Then Set myRange = myCell Else Set myRange = Union(myRange, myCell) End If End If Next myCell If myRange Is Nothing Then MsgBox "No " & IIf(myReply = vbYes, "Locked", "Unlocked") & _ " cells found in the current selection." Exit Sub End If myRange.Select End Sub -- Paul B Always backup your data before trying something new Please post any response to the newsgroups so others can benefit from it Feedback on answers is always appreciated! Using Excel 2002 & 2003 "BFife" wrote in message ... Is there a way to "preview" the locked/unlocked cells in worksheet? |
#3
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Lock/Unlock cells
This will highlight all locked cells that are not empty.
Sub HighlightLockedCells() For Each cell In Range("A1:" & Range("A1").SpecialCells(xlLastCell).Address) If cell.Value < "" _ Then If cell.Locked = True _ Then cell.Interior.ColorIndex = 6 Next cell End Sub "BFife" wrote in message ... Is there a way to "preview" the locked/unlocked cells in worksheet? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
need to paste link from 4 vertical cells to 4 horizontal cells? | Excel Discussion (Misc queries) | |||
Merge Cells | Excel Discussion (Misc queries) | |||
Use the Merge & Center Button with unprotected Cells - sheet prote | Setting up and Configuration of Excel | |||
Help adding text values | Excel Worksheet Functions | |||
Convert data type of cells to Text,Number,Date and Time | Excel Worksheet Functions |