PC Review


Reply
Thread Tools Rate Thread

Change Cell Event

 
 
snax500
Guest
Posts: n/a
 
      3rd Nov 2008
How do I code an event change macro that triggers when cell A2 is
changed.

Thanks
 
Reply With Quote
 
 
 
 
Susan
Guest
Posts: n/a
 
      3rd Nov 2008
Option Explicit

Private Sub Worksheet_Change(ByVal Target As Range)

If Target = ActiveSheet.Range("$A$2") Then
MsgBox "Hello"
End If

End Sub

substitute the msgbox with your code.......
hope that helps!

susan


On Nov 3, 12:19*pm, snax500 <billgottsch...@verizon.net> wrote:
> How do I code an event change macro that triggers when cell A2 is
> changed.
>
> Thanks


 
Reply With Quote
 
Gord Dibben
Guest
Posts: n/a
 
      3rd Nov 2008
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
'Private Sub Worksheet_Calculate()
On Error GoTo stoppit
Application.EnableEvents = False
With Me.Range("A2")
If .Value <> "" Then
MsgBox "A2 was just changed"
End If
End With
stoppit:
Application.EnableEvents = True
End Sub

Right-click on the sheet tab and "View Code"

Copy/paste into that sheet module. Edit to suit.


Gord Dibben MS Excel MVP


On Mon, 3 Nov 2008 09:19:06 -0800 (PST), snax500
<(E-Mail Removed)> wrote:

>How do I code an event change macro that triggers when cell A2 is
>changed.
>
>Thanks


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
apply cell change event to single column - WorksheetChange Event MiataDiablo@gmail.com Microsoft Excel Programming 5 4th May 2008 02:28 AM
Event Macro - On Cell Activate - Change Cell Format Bob@1800-mail.com Microsoft Excel Programming 7 7th Nov 2007 03:36 AM
Cell value change to trigger macro (worksheet change event?) =?Utf-8?B?TmVpbCBHb2xkd2Fzc2Vy?= Microsoft Excel Programming 4 10th Jan 2006 01:55 PM
Datagrid cell change event? Where to find event. Roger Microsoft VB .NET 4 29th Mar 2005 09:45 PM
Change Cell from Validated List Not Firing Worksheet Change Event marston.gould@alaskaair.com Microsoft Excel Programming 3 4th Oct 2004 03:00 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:17 AM.