Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
I forgot my password, how do I open a sheet if I forgot the pass | Excel Worksheet Functions | |||
Sorry forgot the vb code for the header! | Excel Programming | |||
Forgot the Code | Excel Programming | |||
Select a range in code | Excel Programming | |||
Code to Select Row | Excel Programming |