Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default macro on exit of field

Is there a way to run a macro on exiting a cell. For example if I answer Yes
in cell A4, then I would like it to automatically go to A10 on exiting A4.



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 812
Default macro on exit of field

Put this in the appropriate Sheet Module.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$4" Then
If Target = "Yes" Then Range("A10").Select
End If
End Sub

Hth,
Merjet


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default macro on exit of field

You can use the on change code of the worksheet. Right click the sheet tab
and select View Code. I have made the code easy to expand and modify. Paste
the following...

Private Sub Worksheet_Change(ByVal Target As Range)
Select Case Target.Address
Case "$A$4"
If UCase(Target.Value) = "YES" Then Range("A10").Select
Case "$A$10"
MsgBox "Change " & Target.Address
End Select
End Sub

--
HTH...

Jim Thomlinson


"Manuel Murieta" wrote:

Is there a way to run a macro on exiting a cell. For example if I answer Yes
in cell A4, then I would like it to automatically go to A10 on exiting A4.




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default macro on exit of field

This was already answered in a previous post.

In article ,
"Manuel Murieta" wrote:

Is there a way to run a macro on exiting a cell. For example if I answer Yes
in cell A4, then I would like it to automatically go to A10 on exiting A4.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default macro on exit of field

See responses to your same posting in public.excel news group.


Gord Dibben MS Excel MVP

On Tue, 13 Feb 2007 12:41:25 -0500, "Manuel Murieta"
wrote:

Is there a way to run a macro on exiting a cell. For example if I answer Yes
in cell A4, then I would like it to automatically go to A10 on exiting A4.



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
Run a macro on exit More Macro Help Needed Excel Programming 3 January 11th 10 11:34 PM
Run macro on exit Steve Excel Discussion (Misc queries) 12 October 25th 09 01:43 PM
macro wants to exit excel curlydave Excel Discussion (Misc queries) 3 July 2nd 06 04:19 PM
Exit via macro only? Brisbane Rob Excel Discussion (Misc queries) 1 October 13th 05 01:16 PM
on exit macro ditchy Excel Discussion (Misc queries) 2 May 3rd 05 12:11 AM


All times are GMT +1. The time now is 05:16 AM.

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

About Us

"It's about Microsoft Excel"