Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Select locked/unlocked cells

I came across an excellent procedure here in the Excel Programming discussion
group last week but didn't capture it to disk. Would someone be able to
provide the code to select all locked/unlocked cells on a worksheet?

MUCH appreciated!

Training Goddess

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 789
Default Select locked/unlocked cells

Hi Training Goddess (cool name!)
Search this group using

select all locked/unlocked cells

-always search as a first option.
regards
Paul

On Sep 22, 2:57*am, Training Goddess
wrote:
I came across an excellent procedure here in the Excel Programming discussion
group last week but didn't capture it to disk. Would someone be able to
provide the code to select all locked/unlocked cells on a worksheet?

MUCH appreciated!

Training Goddess


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Select locked/unlocked cells

Maybe

Sub mariner()
Dim MyState As Boolean
Dim MyType As String
Dim MyRange As Range, C As Range
response = InputBox("Select What? Locked (L) or Unlocked (U)")
If response = vbCancel Then Exit Sub
Select Case UCase(response)
Case "L"
MyState = True
MyType = "Unlocked"
Case "U"
MyState = False
MyType = "Locked"
Case Else
Exit Sub
End Select
For Each C In ActiveSheet.UsedRange
If C.Locked = MyState Then
If MyRange Is Nothing Then
Set MyRange = C
Else
Set MyRange = Union(MyRange, C)
End If
End If
Next C
If MyRange Is Nothing Then
MsgBox "All cells are " & MyType
Else
MyRange.Select
End If
End Sub

Mike

"Training Goddess" wrote:

I came across an excellent procedure here in the Excel Programming discussion
group last week but didn't capture it to disk. Would someone be able to
provide the code to select all locked/unlocked cells on a worksheet?

MUCH appreciated!

Training Goddess

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
Locked Several Worksheets, allow format cells/select unlocked cell Ana24 Excel Discussion (Misc queries) 2 September 26th 09 01:15 AM
Unlocked cells become locked on paste XP Excel Programming 1 November 28th 07 02:36 AM
Display locked or Unlocked cells Jim May Excel Discussion (Misc queries) 2 August 30th 07 02:50 PM
Searching for locked/unlocked cells Karthik Bhat - Bangalore Excel Programming 2 September 16th 05 04:03 AM
how do you "select locked cells" w/o "select unlocked cells"? princejohnpaulfin Excel Discussion (Misc queries) 3 July 16th 05 03:53 AM


All times are GMT +1. The time now is 06:51 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"