ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   macro on exit of field (https://www.excelbanter.com/excel-programming/383149-macro-exit-field.html)

Manuel Murieta

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.




merjet

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



Jim Thomlinson

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.





JE McGimpsey

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.


Gord Dibben

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.





All times are GMT +1. The time now is 08:39 AM.

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