View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Sam Wilson Sam Wilson is offline
external usenet poster
 
Posts: 523
Default run macro on cell entry


In the VBE window, right click the sheet and view code. Change "(General)"
to "Worksheet" in the top left drop down box, and choose "Change" in the top
right.

Yopu should see:

Private Sub Worksheet_Change(ByVal Target As Range)

End Sub

In the main window. Between these two lines put this:

If Target.Address = "$A$2" And WorksheetFunction.IsNumber(Target.Value) =
True Then Call YourMacro()


Changing "YourMacro()" to the relevant macro.

"sleemo" wrote:

i want a macro to run after a number (any number) has been entered into a
cell i.e a2