Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
don don is offline
external usenet poster
 
Posts: 15
Default Selecting column within a selection

I would like to select a column within a selection.

For instance if the original selection is A1:D10

I would like to select D1:D10 and then manipulate the data.

I have tried many ideas but none seem to work.

For instance why doesn't the following select the first cell in the
last column of the selection. It selects a cell outside the selection
entirely.

Selection(Cells(1, Selection.Columns.Count)).Select

In addition, isn't the selection the range itself?
Msgbox selection.address
gives the correct address of the original selection.

Thanks for any help.

Don

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default Selecting column within a selection

Don,

Selection.Cells(1, Selection.Columns.Count).Select
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware


"don"
wrote in message
I would like to select a column within a selection.

For instance if the original selection is A1:D10
I would like to select D1:D10 and then manipulate the data.
I have tried many ideas but none seem to work.
For instance why doesn't the following select the first cell in the
last column of the selection. It selects a cell outside the selection
entirely.

Selection(Cells(1, Selection.Columns.Count)).Select

In addition, isn't the selection the range itself?
Msgbox selection.address
gives the correct address of the original selection.
Thanks for any help.
Don

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,073
Default Selecting column within a selection

With Selection
..Range(Cells(1, .Columns.Count),
Cells(.Rows.Count, .Columns.Count)).Select
End With

Selects D1:D10 when A1:D10 is the original selection

Ken Johnson


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Selecting column within a selection

I'm not sure what you're doing, but maybe these will give you some more
alternative:

ActiveSheet.Range("a1:d10").Select
Selection.Columns(1).Offset(0, 3).Select

==

ActiveSheet.Range("a1:d10").Select
Selection.Columns(4).Select

==

ActiveSheet.Range("a1:d10").Select
With Selection
.Columns(.Columns.Count).Select
End With

don wrote:

I would like to select a column within a selection.

For instance if the original selection is A1:D10

I would like to select D1:D10 and then manipulate the data.

I have tried many ideas but none seem to work.

For instance why doesn't the following select the first cell in the
last column of the selection. It selects a cell outside the selection
entirely.

Selection(Cells(1, Selection.Columns.Count)).Select

In addition, isn't the selection the range itself?
Msgbox selection.address
gives the correct address of the original selection.

Thanks for any help.

Don


--

Dave Peterson
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
Selecting last five numbers in a selection Scott Excel Discussion (Misc queries) 5 May 27th 09 05:13 PM
how to set shading color of selection when i am selecting cells? N.A. Kamka Setting up and Configuration of Excel 0 May 7th 08 05:14 AM
Selecting Multiple Columns in a Named Selection Griffithpt Excel Worksheet Functions 0 August 9th 06 10:54 PM
Change from Column Selection to Cell Selection Lil Pun[_16_] Excel Programming 4 June 16th 06 10:38 PM
Macro for selecting entire row from mouse cell selection PaiolaS Excel Programming 1 August 7th 03 07:01 PM


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

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"