Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Selecting only locked cells

Hi

I want to be able to set a range variable equal to the cells in a Worksheet
which are locked. I will be using visual basic code.

I have looked at xlspecialcells but with no luck.

Tim






  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default Selecting only locked cells

Might be another way but:

Dim rng As Range
Set rng = ActiveSheet.UsedRange

Dim rngLockedCells As Range
Dim cell As Range
For Each cell In rng
If cell.Locked = True Then
If rngLockedCells Is Nothing Then
Set rngLockedCells = cell
Else
Set rngLockedCells = Union(rngLockedCells,
cell)
End If
End If
Next
rngLockedCells.Select

HTH.

-Brad
-----Original Message-----
Hi

I want to be able to set a range variable equal to the

cells in a Worksheet
which are locked. I will be using visual basic code.

I have looked at xlspecialcells but with no luck.

Tim






.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 120
Default Selecting only locked cells

Hi Tim,

Thanks for participating in the community!

From my understanding to this issue, you are going to obtain one range
object which points to these locked cells in your workbook.

So far as I know, the method from Brad is the solution in this scenario.
From Excel object, there is no one method for us to pick up these locked
cells directly.

If you have any further question regarding this, please feel free to let me
know. Enjoy a nice weekend!

Wei-Dong Xu
Microsoft Product Support Services
Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

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
cursor selecting cells locked on... mmassey Excel Discussion (Misc queries) 3 December 29th 09 06:06 PM
Locked worksheet & hyperlinks (w/ select locked cells unchecked) dgold82 Excel Discussion (Misc queries) 1 July 10th 09 09:42 PM
What to do if the worksheet is locked on selecting rows or cells? ALYAK Excel Discussion (Misc queries) 2 January 10th 07 01:45 PM
paste locked cells and unlocked cells in protected sheet Angeline Excel Worksheet Functions 15 November 1st 06 11:51 PM
Put comments on a locked spreadsheet even though cells not locked RDP Excel Worksheet Functions 1 September 11th 05 11:59 PM


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