#1
|
|||
|
|||
If id cell range is empty then should not allow to fill any other cell
Hi,
I have ID cell Range from a5:a1000, and I want if the user starts filling in any other adjacent cells in that row where id cell range is empty then it should not allow them and message box should pop up that fill in the id cell with cell number. Is it possible? |
#2
|
||||
|
||||
How about restricting the area available with sheet protection e.g. http://www.dummies.com/how-to/conten...-certain-.html ?
You don't need to use a password.
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
#3
|
|||
|
|||
ubns,
I'm thinking that something like the below is what you are wanting. Right click your sheet tab >> View Code >> paste the following into the code pane. Code:
Private Sub Worksheet_Change(ByVal Target As Range) If Target.Cells.Count > 1 Then Exit Sub If Target.Row < 5 Or Target.Row > 1000 Then Exit Sub If Target.EntireRow.Cells(1, 1) <> "" Then Exit Sub nr = Cells(Rows.Count, 1).End(xlUp).Row + 1 MsgBox "Please enter an ID in the next available row before attempting to add other data" Cells(nr, 1).Select Application.EnableEvents = False Target.ClearContents Application.EnableEvents = True End Sub |
Thread Tools | |
Display Modes | |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Assign the value of a cell as a cell reference of another cell in Excel 2010 - How to? | bharathkumarst | Excel | 7 | 10-13-2014 10:25 AM |
Delete empty cell and shift up | Linh | Word Tables | 1 | 09-21-2014 01:52 PM |
Change formula cell range based on cell value | Scoth | Excel | 4 | 10-25-2012 07:51 AM |
Limit cell range use | talkinglens | Excel | 6 | 12-31-2010 08:43 PM |
How can I fill cell color starting from Cell D5 using Conditional formatting instead | Learner7 | Excel | 0 | 07-08-2010 05:50 AM |