ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Using up, dwn, end, right, left in vb programming (https://www.excelbanter.com/excel-programming/286972-using-up-dwn-end-right-left-vbulletin-programming.html)

Michael Kintner

Using up, dwn, end, right, left in vb programming
 
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



John Wilson

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

Try this:

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

John

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





John Wilson

Using up, dwn, end, right, left in vb programming
 
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

"John Wilson" wrote in message
...
Mike,

Try this:

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

John

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







Michael Kintner

Using up, dwn, end, right, left in vb programming
 
Still having problems, how do I do two end downs?

"John Wilson" wrote in message
...
Mike,

Try this:

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

John

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







John Wilson

Using up, dwn, end, right, left in vb programming
 
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

"Michael Kintner" wrote in message
...
Still having problems, how do I do two end downs?

"John Wilson" wrote in message
...
Mike,

Try this:

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

John

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










All times are GMT +1. The time now is 02:46 PM.

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