macro on exit of field

  • Thread starter Thread starter Manuel Murieta
  • Start date Start date
M

Manuel Murieta

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.
 
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
 
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
 
See responses to your same posting in public.excel news group.


Gord Dibben MS Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top