slection change to make the selection go down 1 cell

B

Billy

i need a macro that will move the selection down 1 row if certain
cells are selected. the cells are e13, e15, e17, e19, etc. If e13 is
selected, i want the selection to go down 1 row, so that if e13 is
selected, the selection changes to e14, and if e15 is slected, it
changes to e16, etc.

thanks!

Tonso
 
R

Rick Rothstein

You waited a whole 4 minutes on a weekend before reposting your question...
I've heard said that patience is a virtue<g> and keep in mind the people who
answer questions on newsgroups are volunteers, not full time monitors, so
you have to wait until someone who knows about the subject matter your
question deals with comes along... that could be a couple of minutes, an
hour or two or not until the next day. Anyway, I just posted a response
against your question against your first message.
 
G

Gord Dibben

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Const WS_RANGE As String = "e13,e15,e17,e19" 'you add etc to the range

On Error GoTo ws_exit
Application.EnableEvents = False

If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
Target.Offset(1, 0).Select

End If

ws_exit:
Application.EnableEvents = True
End Sub

Copy/paste this event code to your sheet module.


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

Top