Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 921
Default how to find last row/col index within a selected range

Hi all,
The application has selected a contiguous range (no empty cell) within a
column (say, from cell B2 to B15). I need to run an analysis on the values
of the selected cells (therefore i'll need loop thru the selected range).
Can someone please tell me how can I locate the upper bound (index) and lower
bound (index) of that range?


Thanks,
Jeff
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default how to find last row/col index within a selected range

Here's a sample snip that returns the first and last cell of any selected
range

Dim rng As Range
Dim rngLower As Range
Dim rngUpper As Range

Set rng = Selection
Set rngLower = rng.Resize(1, 1)
Set rngUpper = rng.Resize(1, 1).Offset(rng.Rows.Count - 1,
rng.Columns.Count - 1)

MsgBox rngLower.Address
MsgBox rngUpper.Address


--
Charles
www.officezealot.com


"Jeff" wrote in message
...
Hi all,
The application has selected a contiguous range (no empty cell) within a
column (say, from cell B2 to B15). I need to run an analysis on the
values
of the selected cells (therefore i'll need loop thru the selected range).
Can someone please tell me how can I locate the upper bound (index) and
lower
bound (index) of that range?


Thanks,
Jeff



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default how to find last row/col index within a selected range

Hi
see:
http://www.xldynamic.com/source/xld.LastValue.html#vba

--
Regards
Frank Kabel
Frankfurt, Germany

"Jeff" schrieb im Newsbeitrag
...
Hi all,
The application has selected a contiguous range (no empty cell)

within a
column (say, from cell B2 to B15). I need to run an analysis on the

values
of the selected cells (therefore i'll need loop thru the selected

range).
Can someone please tell me how can I locate the upper bound (index)

and lower
bound (index) of that range?


Thanks,
Jeff


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
How do I find out how many rows I have selected? ABR Excel Discussion (Misc queries) 7 April 3rd 23 10:56 AM
HELP need index of the actual selected point Schlupp Charts and Charting in Excel 4 August 11th 05 06:56 AM
find row index crew3407[_14_] Excel Programming 4 May 12th 04 06:54 PM
How To: Get the index value of the selected color KM[_2_] Excel Programming 1 December 10th 03 04:42 PM
How to find out what the user selected? Mike[_31_] Excel Programming 0 July 24th 03 11:02 AM


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