Automatically select entire rows on pressing down and up-arrow key

A

andreashermle

Dear Experts:

The following code snippets selects the entire row of the currently
selected cell

Rows(ActiveCell.Row).Select

Is it possible to link this entire row selection command to the up and
down arrows of the keyboard?

For example:
The currently selected cell is B5. Pressing the down-arrow-key brings
me to B6. The entire sixth row is to be selected automatically without
manually activating the selection macro.

Is this feasible?

Help is much appreciated.

Thank you very much in advance. Regards, Andreas
 
G

Gord Dibben

Here is sheet event code which will select the entire row of any cell you arrow
to or mouse-click.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Rows(ActiveCell.Row).Select
End Sub

But, I don't think it is what you want.

Do you also want to be able to select single cells or ranges which are not an
entire row?

How specific do you need your selection(s) to be?


Gord Dibben MS Excel MVP
 
A

andreashermle

Here is sheet event code which will select the entire row of any cell youarrow
to or mouse-click.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    Rows(ActiveCell.Row).Select
End Sub

But, I don't think it is what you want.

Do you also want to be able to select single cells or ranges which are not an
entire row?

How specific do you need your selection(s) to be?

Gord Dibben     MS Excel MVP

Dear Gord,

thank you very much for your professional support. This is exactly
what I wanted.

This is great support.

Regards, Andreas
 

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