View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Gord Dibben Gord Dibben is offline
external usenet poster
 
Posts: 22,906
Default AUTOMATIC EXECUTION

A particular cell or a range of cells or?

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
'when entering data in any cell in Col A
On Error GoTo enditall
Application.EnableEvents = False
If Target.Cells.Column = 1 Then
With Target
If .Value < "" Then
yourmacroname
End If
End With
End If
enditall:
Application.EnableEvents = True
End Sub


Gord Dibben MS Excel MVP

On Fri, 28 Dec 2007 12:51:03 -0800, VB_User
wrote:

I would like to execute a macro every time the "Enter" key is depressed (or
an entry is made to an Excel cell). Is there a way to do this with a special
macro (Visual Basic)? Or, is there another way?