moving to next cell

M

Matt Houston

Hi,

if I have a row selected, how can I select the first cell in the nex
row using VBA

thank
 
D

Don Guillett

Here is one I use to goto the next row 6 cells to the left if I am now in
col 8 by using the right arrow key.
right click sheet tab>view code>insert this>modify to suit>save

Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
If Target.Row > 5 And Target.Column = 8 Then ActiveCell.Offset(1, -6).Select
End Sub
 
D

Don Guillett

that only goes down one from the active cell but this goes to col A of the
next row

Cells(ActiveCell.Row + 1, "a").Select

--
Don Guillett
SalesAid Software
[email protected]
Jack Schitt said:
How about

ActiveWindow.RangeSelection.Offset(1, 0).Resize(1, 1).Select
 
J

Jack Schitt

Sorry, I had thought that was the required specification.

--
Return email address is not as DEEP as it appears
Don Guillett said:
that only goes down one from the active cell but this goes to col A of the
next row

Cells(ActiveCell.Row + 1, "a").Select
 
J

Jack Schitt

Actually I find that I have to disagree with you, having tested it out.
Both methods appear to have the same effect.
I selected row 5
I then hit the enter key a few times so that the active cell within the
selection shifted to the right by a few columns without deselecting the row.
I then ran the macro as originally suggested by me:
ActiveWindow.RangeSelection.Offset(1, 0).Resize(1, 1).Select
and the selection changed to a single cell in column "A" immediately below
the previous selection, ie in this case A6.

Don Guillett said:
that only goes down one from the active cell but this goes to col A of the
next row

Cells(ActiveCell.Row + 1, "a").Select
 
D

Don Guillett

The only way I could get yours to work with xl2002 was to SELECT (highlight)
the range of the row.
 
Top