Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 788
Default Specific cell

Hello,

I am currently building an Excel sheet that need to show a message if a user
changes the value of a specific cell.
For example the message needs to appear if the value of the cell A1 is below
ten, but I only want to show the message when the user changes the value. So
if the user changes cell B1 and the value of A1 is below ten I dont want the
message to appear.

Can anybody help me out?

Best regards,

Chris

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Specific cell

Private Sub Worksheet_Change(ByVal Target As Range)

On Error GoTo ws_exit:
Application.EnableEvents = False
If Target.Address = "$A$1" Then
If Target.Value < 10 Then
MsgBox "A1 changed"
End If
End If

ws_exit:
Application.EnableEvents = True
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.


--
HTH

Bob Phillips

"chris" wrote in message
...
Hello,

I am currently building an Excel sheet that need to show a message if a

user
changes the value of a specific cell.
For example the message needs to appear if the value of the cell A1 is

below
ten, but I only want to show the message when the user changes the value.

So
if the user changes cell B1 and the value of A1 is below ten I don't want

the
message to appear.

Can anybody help me out?

Best regards,

Chris



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 788
Default Specific cell

Bob,

Thanks for you help it works.

Best regards,

Chris

"Bob Phillips" wrote:

Private Sub Worksheet_Change(ByVal Target As Range)

On Error GoTo ws_exit:
Application.EnableEvents = False
If Target.Address = "$A$1" Then
If Target.Value < 10 Then
MsgBox "A1 changed"
End If
End If

ws_exit:
Application.EnableEvents = True
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.


--
HTH

Bob Phillips

"chris" wrote in message
...
Hello,

I am currently building an Excel sheet that need to show a message if a

user
changes the value of a specific cell.
For example the message needs to appear if the value of the cell A1 is

below
ten, but I only want to show the message when the user changes the value.

So
if the user changes cell B1 and the value of A1 is below ten I don't want

the
message to appear.

Can anybody help me out?

Best regards,

Chris




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default Specific cell

Here's another option that doesn't require coding.

From the Data Menu, select Validation. The resulting dialog box

provides methods for establishing entered range values as well as a
custom message box when the range has been exceeded.

regards,

mike

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
Not allowing to continu unless a specific cell has specific answer madubois9 Excel Discussion (Misc queries) 3 October 25th 07 12:45 AM
Link to specific cell in specific Excel file JeroenM Excel Discussion (Misc queries) 3 July 6th 07 10:08 AM
Link from a specific Cell in Excel to a specific para. in Word CathyK Excel Worksheet Functions 0 August 10th 06 04:40 PM
Highlight a row if a specific cell is specific numbers/words sea0221 Excel Worksheet Functions 2 March 9th 05 12:06 AM
How do I make a cell date specific to input a value on a specific. ebuzz13 Excel Discussion (Misc queries) 1 January 18th 05 05:53 PM


All times are GMT +1. The time now is 10:06 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"