LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 287
Default Allowing entry only once

I have the following code which prevents the user to edit the cell A1 more
than once

Private Sub Worksheet_Change(ByVal Target As Range)
Dim Original As Variant
Dim NewVal As Variant
If Target.Count 1 Then Exit Sub
If Target.Address = "$A$1" Then
NewVal = Target.Value
Application.EnableEvents = False
Application.Undo
Original = Target.Value
If Original = "" Then
Target = NewVal
Else
MsgBox "No change to this cell is allowed"
End If
Application.EnableEvents = True
End If
End Sub

How do I edit this code to make it work for more than A1 i.e. A1:A100
Thanks
Adam
 
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
Locking from data entry but allowing oulining to function? saharafrog Excel Discussion (Misc queries) 1 March 26th 10 08:29 PM
Allowing data entry in protected sheets David Excel Discussion (Misc queries) 1 November 7th 06 09:18 PM
exel 2003 suddenly stopped allowing data entry Michael Excel Discussion (Misc queries) 0 October 25th 06 02:42 AM
Allowing Data Entry ONLY??? mthespike Excel Worksheet Functions 1 June 29th 05 08:11 PM
Allowing only one entry in a range McKenna New Users to Excel 7 March 11th 05 04:56 PM


All times are GMT +1. The time now is 11:45 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"