View Single Post
 
Old 01-15-2013, 10:12 AM
tadleymansions tadleymansions is offline Windows XP Office 2003
Novice
 
Join Date: Aug 2012
Posts: 3
tadleymansions is on a distinguished road
Unhappy Unlocking cells with VB code in excel 2003

Hi
Using excel 2003 I am unable to get cells unlocked using VB. I have been going round and round for weeks with this problem and am now ready for the "funny farm"!

I know that I have had this working on previous occasions but now seem unable to get the simplest of code to work.

For Example:-
A single worksheet with all cells defined as general and all locked EXCEPT D1.

The simple code:-

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("D:D")) Is Nothing Then
Target.Offset(3, -3).Locked = False
Target.Offset(3, -3).Select
End If

End Sub

Gives "Run time error 1004"
Unable to set the Locked property of the Range class.

Before my brain turns to total mush can someone please, please point out where I am going wrong.

Last edited by tadleymansions; 01-16-2013 at 02:47 AM. Reason: smiley caused typo
Reply With Quote