View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips Bob Phillips is offline
external usenet poster
 
Posts: 10,593
Default "after update" type macro

Option Explicit

Private Sub Worksheet_Change(ByVal Target As Range)
'Enter comment text here
Const WS_RANGE As String = "G:G" '<== change to suit

On Error GoTo ws_exit
Application.EnableEvents = False

If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
With Target
' do your stuff
End With
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

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Papa Jonah" wrote in message
...
I know that in Access, I can cause things to happen when a field has been
changed. I want to do something similar in Excel. If any cell in a given
column (G) changes, I want a macro to run that will force the user to
enter
data in another cell.
How do I make one of these "after update"- type things happen?

TIA
Papa