Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 304
Default 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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 76
Default 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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 304
Default 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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 76
Default 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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
I forgot my password, how do I open a sheet if I forgot the pass Hector Solorzano Excel Worksheet Functions 4 February 20th 13 05:08 AM
Sorry forgot the vb code for the header! SV[_3_] Excel Programming 2 October 18th 07 03:22 PM
Forgot the Code Duncan_J Excel Programming 1 February 2nd 06 10:01 PM
Select a range in code JCanyoneer Excel Programming 3 December 20th 04 10:23 PM
Code to Select Row David McRitchie[_2_] Excel Programming 0 September 19th 03 11:02 PM


All times are GMT +1. The time now is 11:47 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"