Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Worksheet Change
I need to regulate the entries made on a spreadsheet to column N. amusing the following - Private Sub Worksheet_Change(ByVal Target As Range) If Target = "sent to TS for payment" Then End If Target = "sent to Emma" Then End MsgBox ("NO") Else End If End Sub Basically an entry made in column N must be one of the above condition set in the IF statements. How do I set the range these IF statement apply to -- SeanEvan ----------------------------------------------------------------------- SeanEvans's Profile: http://www.excelforum.com/member.php...fo&userid=1465 View this thread: http://www.excelforum.com/showthread.php?threadid=32012 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Worksheet Change
You could use something like this to evaluate changes to column N or th 14th column. Code ------------------- Private Sub Worksheet_Change(ByVal Target As Excel.Range) If Target.Column = 14 Then If Target = "sent to TS for payment" Or Target = "sent to Emma" Then MsgBox "No" Exit Sub End If End If End Su ------------------- An alternative is to name the range you want to evaluate instead o looking at all of column N. In this example, my named range i "EvalRange". Code ------------------- Private Sub Worksheet_Change(ByVal Target As Excel.Range) If Not Intersect(Target, Range("EvalRange")) Is Nothing Then If Target = "sent to TS for payment" Or Target = "sent to Emma" Then MsgBox "No" Exit Sub End If End If End Su ------------------- If you're just validating input, you might be better off using Data Validation from Excel and not even use VBA. HTH, Steve Hie -- shie ----------------------------------------------------------------------- shieb's Profile: http://www.excelforum.com/member.php...fo&userid=1640 View this thread: http://www.excelforum.com/showthread.php?threadid=32012 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
how to change the pivot chart automaticaly as values in the worksheet change | Excel Worksheet Functions | |||
VBA Worksheet change name | Excel Discussion (Misc queries) | |||
change formula in a shared worksheet without losing change history | Excel Worksheet Functions | |||
Help Please, Worksheet Change | Excel Worksheet Functions | |||
Change Cell from Validated List Not Firing Worksheet Change Event | Excel Programming |