Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
JackR
 
Posts: n/a
Default 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,

  #2   Report Post  
Posted to microsoft.public.excel.misc
CLR
 
Posts: n/a
Default 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,

  #3   Report Post  
Posted to microsoft.public.excel.misc
JackR
 
Posts: n/a
Default 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,

  #4   Report Post  
Posted to microsoft.public.excel.misc
CLR
 
Posts: n/a
Default 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,

  #5   Report Post  
Posted to microsoft.public.excel.misc
John James
 
Posts: n/a
Default 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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Row Expansion Susan Excel Worksheet Functions 11 February 28th 06 07:15 PM
Urgent date/scheduling calc needed jct Excel Worksheet Functions 3 February 24th 06 01:36 AM
checking that cells have a value before the workbook will close kcdonaldson Excel Worksheet Functions 8 December 5th 05 04:57 PM
Macro help - copy a cell down gjcase Excel Discussion (Misc queries) 3 September 4th 05 05:09 AM
GET.CELL Biff Excel Worksheet Functions 2 November 24th 04 07:16 PM


All times are GMT +1. The time now is 06:37 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"