Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Determine exctent of selected range

I would like to determine the maximum row and column references for a
selected range of cells,

Thanks,
Mike


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default Determine exctent of selected range

One way:

Dim nLastRow As Long
Dim nLastCol As Long
With Selection
nLastRow = .Item(.Count).Row
nLastCol = .Item(.Count).Column
End With

In article ,
"Michael Allen" wrote:

I would like to determine the maximum row and column references for a
selected range of cells,

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 770
Default Determine exctent of selected range

Michael,

If you mean you'd like to determine the last row and column in the selected
range then this would do it:

MsgBox "last row is" & Selection.Rows(Selection.Rows.Count).Row & vbCr & _
"last column is " &
Selection.Columns(Selection.Columns.Count).Column

If you just want the number of rows or columns in the selection, use the
parts inside the parens.

Michael Allen" wrote in message
. ..
I would like to determine the maximum row and column references for a
selected range of cells,

Thanks,
Mike




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
determine the name of the selected pivot table Tim879 Excel Discussion (Misc queries) 1 September 23rd 07 05:02 PM
Determine the Row in a Range Tom Ogilvy Excel Programming 0 April 30th 04 02:49 PM
How do you determine if it's the 1st row/col of a specified range? SuperJas Excel Programming 2 April 7th 04 09:46 AM
Determine range with VBA Bryon[_2_] Excel Programming 1 October 25th 03 06:52 PM
Determine Selected Cells John Tripp[_2_] Excel Programming 2 July 31st 03 02:48 PM


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

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

About Us

"It's about Microsoft Excel"