Using up, dwn, end, right, left in vb programming

  • Thread starter Michael Kintner
  • Start date
M

Michael Kintner

I would like to set a print area using the arrow keys. If I turn on the
macro recorder it dows not show how the keys sequences are created.

What is the vb code to start at cell A10 and range select end down, end
right then right once?

Thank you for your help in advance!!! (smile) I;m in a real bind....

Mike
 
J

John Wilson

Mike,

Try this:

range(range("A10"), range("A10").end(xlDown)).resize(,2).Select

John
 
J

John Wilson

Mike,

After re-reading your post, I think that this may do what you want:

range(range("A10").End(xlToRight).Offset(0,1),
range("A10").end(xlDown)).Select

John
 
J

John Wilson

Michael,

How is your data set up?
The End(xlDown) should get you to the last non blank cell under A10.
Is there more information below that (skipping a row)???

maybe this will work (all one line):
range(range("A10").End(xlToRight).Offset(0,1), range("A" &
rows.count).end(xlup)).Select
The above will select Range A10 down to the very last non blank cell in
column "A"
and one column to the right of the last non blank cell in Row 10.

John
 
Top