Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
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
how to change the pivot chart automaticaly as values in the worksheet change Vinay Vasu Excel Worksheet Functions 0 May 3rd 10 04:25 PM
VBA Worksheet change name James C[_2_] Excel Discussion (Misc queries) 2 January 26th 10 05:34 PM
change formula in a shared worksheet without losing change history DCE Excel Worksheet Functions 5 July 25th 08 01:37 PM
Help Please, Worksheet Change ilvmgicker Excel Worksheet Functions 1 June 14th 06 09:41 AM
Change Cell from Validated List Not Firing Worksheet Change Event [email protected] Excel Programming 3 October 4th 04 03:00 AM


All times are GMT +1. The time now is 08:20 AM.

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

About Us

"It's about Microsoft Excel"