View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Ken[_27_] Ken[_27_] is offline
external usenet poster
 
Posts: 24
Default locking cells from specific point to infinity

Thanks for your reply!

While attempting to figure out your code, I'm curious as to why:
1) are you using Resize
2) is the Rows.Count -61, rather then Rows.Count, 62

Ken

"Chip Pearson" wrote in message
...
By default, all cells are locked, so you first need to unlock
everything and then selectively lock the desired ranges. E.g.,

Sub AAA()
Dim WS As Worksheet
Set WS = Worksheets("Sheet1")
With WS
.Cells.Locked = False
.Cells(1, "J").Resize(.Rows.Count, 1).Locked = True
.Cells(62, "A").Resize(.Rows.Count - 61).Locked = True
.Protect
End With
End Sub

Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group, 1998 - 2009
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)



On Sat, 12 Sep 2009 11:58:49 -0700, "Ken"
wrote:

I would like to lock all cells starting from J1 to infinity and from A62
to
infinity using VB.

Anyone have any ideas?

Ken