Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 171
Default Range(Selection, Selection.End(xlToRight)).Select

This line of Code:

Range(Selection, Selection.End(xlToRight)).Select

...comes up a couple of Columns short. The reason is obvious, the first of
the two missing Columns (T) is empty, but the one to the right of it (U)is
not. As I am selecting multiple Rows at the same time, and intend to run this
macro on a number of WS, each of which may or may not be populated in the
cells of those last two columns -- and may even find columns R and S empty
on some WS, but the number of Rows in each WS will vary, how do I tell the
Macro to Select the Columns I really want?
--
Dave
Temping with Staffmark
in Rock Hill, SC
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default Range(Selection, Selection.End(xlToRight)).Select

Without knowing "the columns you really want", perhaps:

Intersect(Selection.EntireRow, Range("C:U")).Select




In article ,
Dave Birley wrote:

This line of Code:

Range(Selection, Selection.End(xlToRight)).Select

..comes up a couple of Columns short. The reason is obvious, the first of
the two missing Columns (T) is empty, but the one to the right of it (U)is
not. As I am selecting multiple Rows at the same time, and intend to run this
macro on a number of WS, each of which may or may not be populated in the
cells of those last two columns -- and may even find columns R and S empty
on some WS, but the number of Rows in each WS will vary, how do I tell the
Macro to Select the Columns I really want?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Range(Selection, Selection.End(xlToRight)).Select

Dave,

Range(Selection, Cells(Selection.Row, 256).End(xlToLeft)).Select

But, if there are additional columns that you don't want that are to the right of column U then use

Intersect(Selection.EntireRow, _
Range(Selection.EntireColumn, Range("U:U").EntireColumn)).Select

Though there isn't any need to Select the range....


HTH,
Bernie
MS Excel MVP


"Dave Birley" wrote in message
...
This line of Code:

Range(Selection, Selection.End(xlToRight)).Select

..comes up a couple of Columns short. The reason is obvious, the first of
the two missing Columns (T) is empty, but the one to the right of it (U)is
not. As I am selecting multiple Rows at the same time, and intend to run this
macro on a number of WS, each of which may or may not be populated in the
cells of those last two columns -- and may even find columns R and S empty
on some WS, but the number of Rows in each WS will vary, how do I tell the
Macro to Select the Columns I really want?
--
Dave
Temping with Staffmark
in Rock Hill, SC



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
Select last cell in Selection jlclyde Excel Discussion (Misc queries) 4 June 27th 08 09:23 PM
Copy Selection - Transpose Selection - Delete Selection Uninvisible Excel Discussion (Misc queries) 2 October 23rd 07 04:18 PM
Identifying a selection of a selection of a range swimfast Excel Worksheet Functions 1 March 1st 07 02:51 AM
Select another Textbox After Selection Corey Excel Programming 1 February 21st 07 10:40 PM
Excel VBA - Range(Selection, Selection.End(xlDown)).Name issue. jonH Excel Programming 3 June 7th 04 09:13 PM


All times are GMT +1. The time now is 01:19 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"