Run Macro when cell is filled

J

JackR

I need to have a macro start when one cell in my worksheet is filled in, how
would the code read to do this.
The cell I want to use is A5

Thanks,
 
C

CLR

Try this.....

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Application.Intersect(Target, Range("A5")) Is Nothing Then
MsgBox "Put your code here!"
End If
End Sub

hth
Vaya con Dios,
Chuck, CABGx3
 
J

JackR

Thanks, what would be the code where you state "put code here", is this where
I place the name of the macro?? can you be a little more specific, still new
to this.

Thanks,
 
C

CLR

Sorry Jack...........
Yes, just replace my entire line

MsgBox "Put your code here!"

with this

Call YourMacroName

of course using your real macro name in place of YourMacroName

hth
Vaya con Dios,
Chuck, CABGx3
 
J

John James

For the code to work it needs to be associated with that sheet.

In excel right click the sheet tab and select view code. Then past
CLR's code, test it and adjust as necessary
 
Top