close

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,Try this.....

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

hth
Vaya con Dios,
Chuck, CABGx3
quot;JackRquot; wrote:

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

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

Thanks,

quot;CLRquot; wrote:

gt; Try this.....
gt;
gt; Private Sub Worksheet_Change(ByVal Target As Range)
gt; If Not Application.Intersect(Target, Range(quot;A5quot;)) Is Nothing Then
gt; MsgBox quot;Put your code here!quot;
gt; End If
gt; End Sub
gt;
gt; hth
gt; Vaya con Dios,
gt; Chuck, CABGx3
gt;
gt;
gt;
gt; quot;JackRquot; wrote:
gt;
gt; gt; I need to have a macro start when one cell in my worksheet is filled in, how
gt; gt; would the code read to do this.
gt; gt; The cell I want to use is A5
gt; gt;
gt; gt; Thanks,
gt; gt;

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

MsgBox quot;Put your code here!quot;

with this

Call YourMacroName

of course using your real macro name in place of YourMacroName

hth
Vaya con Dios,
Chuck, CABGx3quot;JackRquot; wrote:

gt; Thanks, what would be the code where you state quot;put code herequot;, is this where
gt; I place the name of the macro?? can you be a little more specific, still new
gt; to this.
gt;
gt; Thanks,
gt;
gt; quot;CLRquot; wrote:
gt;
gt; gt; Try this.....
gt; gt;
gt; gt; Private Sub Worksheet_Change(ByVal Target As Range)
gt; gt; If Not Application.Intersect(Target, Range(quot;A5quot;)) Is Nothing Then
gt; gt; MsgBox quot;Put your code here!quot;
gt; gt; End If
gt; gt; End Sub
gt; gt;
gt; gt; hth
gt; gt; Vaya con Dios,
gt; gt; Chuck, CABGx3
gt; gt;
gt; gt;
gt; gt;
gt; gt; quot;JackRquot; wrote:
gt; gt;
gt; gt; gt; I need to have a macro start when one cell in my worksheet is filled in, how
gt; gt; gt; would the code read to do this.
gt; gt; gt; The cell I want to use is A5
gt; gt; gt;
gt; gt; gt; Thanks,
gt; gt; gt;


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 paste
CLR's code, test it and adjust as necessary.--
John James
------------------------------------------------------------------------
John James's Profile: www.excelforum.com/member.php...oamp;userid=32690
View this thread: www.excelforum.com/showthread...hreadid=524909

全站熱搜
創作者介紹
創作者 software 的頭像
software

software

software 發表在 痞客邦 留言(0) 人氣()