ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   slection change to make the selection go down 1 cell (https://www.excelbanter.com/excel-programming/441999-slection-change-make-selection-go-down-1-cell.html)

Billy[_6_]

slection change to make the selection go down 1 cell
 
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

Rick Rothstein

slection change to make the selection go down 1 cell
 
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.

--
Rick (MVP - Excel)



"Billy" wrote in message
...
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



Gord Dibben

slection change to make the selection go down 1 cell
 
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

On Sat, 24 Apr 2010 11:39:28 -0700 (PDT), Billy
wrote:

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




All times are GMT +1. The time now is 04:22 AM.

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