Moving an active cell

H

Howard

I need a snippet of code that will (when you use ctrl-d) look at the active
cell, move the cursor down 9 cells (same column) and make that cell the
active cell, no matter where you start on the spreadsheet.
Any ideas?
Thanks to everyone.
 
M

Mike H

Hi,

Alt+F11 to open VB editor, Right click 'ThisWorkbook' and insert module and
paste the code in

Sub Move_me()
ActiveCell.Offset(9).Select
End Sub

Back on the worksheet
Tools|Macro - Macros - navigate to the macro then 'Options' and assign the
shortcut CTRL+D
--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.
 
R

Ryan H

Put this in the Workbook_Open Event:

Private Sub Workbook_Open()
Application.OnKey "^d", "MoveCursor"
End Sub

Put this in a standard module:

Sub MoveCursor()
On Error Resume Next
ActiveCell.Offset(9).Select
End Sub

Hope this helps! If so, let me know, click "YES" below.
 

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