![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Feb 2002
Posts: 133
|
I need to validate a cell thus:
if cell B14="C" have the validation throw up a message when the user tries to enter data in cell D14. Help ! |
|
|
|
|
|
#2 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: Auckland, New Zealand
Posts: 4,209
|
Quote:
Goto Allow > Custom And enter this formula B14="C" |
|
|
|
|
|
|
#3 |
|
Board Regular
Join Date: Apr 2002
Location: Greenwood, SC
Posts: 677
|
I looked at the reply above, but it doesn't allow you to customize the message. Plus, I've never used data validation before. Here's another way.
Enter this code in the code section for the worksheet of interest: Private Sub Worksheet_Change(ByVal Target As Range) If Target.Row = 14 And Target.Column = 4 Then If LCase(Cells(14, 2).Value) = "c" Then MsgBox "Your message here" End If End If End Sub This macro will run whenever the user enters data into cell D14. If you want the user to get the message whenever the cell is selected, you should change the first line of the code to: Private Sub Worksheet_SelectionChange(ByVal Target As Range) K [ This Message was edited by: kkknie on 2002-05-16 07:36 ] |
|
|
|
|
|
#4 |
|
Board Regular
Join Date: Feb 2002
Posts: 133
|
Cheers Guys.
|
|
|
|
|
|
#5 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: Auckland, New Zealand
Posts: 4,209
|
Quote:
and requires no coding so macros disabled is not a problem. |
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|