![]() |
Forgot where I put the Select all VB code, help.
Hello all,
What is the code that will select A2:E2, shift+down arrow to last cell then shift+up arrow? Range(Selection, Selection.End(xlDown)).Select Range(Selection, Selection.End(xlUp)).Select But this just goes down 1 cell, I need to go to the last cell in A:E. Thanks |
Forgot where I put the Select all VB code, help.
PGarcia -
It seems you could accomplish this by selecting from A3:E3 to the end, and then offsetting your selection by -1. Range("A3:E3").Select Range(Selection, Selection.End(xlDown)).Select Selection.Offset(-1, 0).Select -- HTH, Brad E. "pgarcia" wrote: Hello all, What is the code that will select A2:E2, shift+down arrow to last cell then shift+up arrow? Range(Selection, Selection.End(xlDown)).Select Range(Selection, Selection.End(xlUp)).Select But this just goes down 1 cell, I need to go to the last cell in A:E. Thanks |
Forgot where I put the Select all VB code, help.
I remmeber it being something else, but (man!) I can't remmeber where I used
it. It bugs out. It needs to shift down to the last row, in this case 65536, then come up one. That should only pick up cells in thouse columns. Thanks, if you know it cool if now I guess I'll keep looking. "Brad E." wrote: PGarcia - It seems you could accomplish this by selecting from A3:E3 to the end, and then offsetting your selection by -1. Range("A3:E3").Select Range(Selection, Selection.End(xlDown)).Select Selection.Offset(-1, 0).Select -- HTH, Brad E. "pgarcia" wrote: Hello all, What is the code that will select A2:E2, shift+down arrow to last cell then shift+up arrow? Range(Selection, Selection.End(xlDown)).Select Range(Selection, Selection.End(xlUp)).Select But this just goes down 1 cell, I need to go to the last cell in A:E. Thanks |
Forgot where I put the Select all VB code, help.
PGarcia, Try this one:
Range("A2:E2").Select Range(Selection, Selection.End(xlDown)).Select Selection.Resize(Selection.Rows.Count - 1).Select There is a Row and Column entry for the Resize command, but by omitting the column entry, the # of columns remains the same. To omit the row entry would be: Selection.Resize(, Selection.Columns.Count - 1).Select -- HTH, Brad E. "pgarcia" wrote: Hello all, What is the code that will select A2:E2, shift+down arrow to last cell then shift+up arrow? Range(Selection, Selection.End(xlDown)).Select Range(Selection, Selection.End(xlUp)).Select But this just goes down 1 cell, I need to go to the last cell in A:E. Thanks |
All times are GMT +1. The time now is 05:51 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com