ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Run Macro when cell is filled (https://www.excelbanter.com/excel-discussion-misc-queries/78724-run-macro-when-cell-filled.html)

JackR

Run Macro when cell is filled
 
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,


CLR

Run Macro when cell is filled
 
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



"JackR" wrote:

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,


JackR

Run Macro when cell is filled
 
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,

"CLR" wrote:

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



"JackR" wrote:

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,


CLR

Run Macro when cell is filled
 
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


"JackR" wrote:

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,

"CLR" wrote:

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



"JackR" wrote:

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,


John James

Run Macro when cell is filled
 

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: http://www.excelforum.com/member.php...o&userid=32690
View this thread: http://www.excelforum.com/showthread...hreadid=524909



All times are GMT +1. The time now is 07:05 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com