Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 152
Default Basic Range Question

Can someone point me to a set of functions or properties for set ranges?
Specifically I'm looking for the following:

For a range of cells:
Upper & Lower Left Cell Address
Upper & Lower Right Cell Address

Left & Right Column Number
Top & Bottom Row Number

These are probably just properties of a range object but I can't seem to
find them in help... I know it's probably one of those "it's so easy a
Caveman could do it" things that I'm just missing.

Thanks
MikeZz
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 152
Default Basic Range Question

Thanks Gary... I know it was easy but just couldn't find the right property.

"Gary''s Student" wrote:

This might be of some help:

Sub range_reporter()
Dim r As Range
Dim s As String
Set r = ActiveSheet.UsedRange

nLastRow = r.Rows.Count + r.Row - 1
MsgBox ("last row " & nLastRow)

nLastColumn = r.Columns.Count + r.Column - 1
MsgBox ("last column " & nLastColumn)

nFirstRow = r.Row
MsgBox ("first row " & nFirstRow)

nFirstColumn = r.Column
MsgBox ("first column " & nFirstColumn)

numrow = r.Rows.Count
MsgBox ("number of rows " & numrow)

numcol = r.Columns.Count
MsgBox ("number of columns " & numcol)

s = r.Address
MsgBox ("address " & s)

s = r(1).Address
MsgBox ("address of first cell " & s)
End Sub
--
Gary''s Student - gsnu200831


"MikeZz" wrote:

Can someone point me to a set of functions or properties for set ranges?
Specifically I'm looking for the following:

For a range of cells:
Upper & Lower Left Cell Address
Upper & Lower Right Cell Address

Left & Right Column Number
Top & Bottom Row Number

These are probably just properties of a range object but I can't seem to
find them in help... I know it's probably one of those "it's so easy a
Caveman could do it" things that I'm just missing.

Thanks
MikeZz

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
Basic Range Question Rick Rothstein Excel Programming 0 February 4th 09 10:31 PM
Basic Range Question Gary''s Student Excel Programming 0 February 4th 09 09:05 PM
Basic VBA Question amirstal Excel Programming 5 December 18th 06 05:09 PM
Another basic question... CASE with a range Phillips Excel Programming 3 November 19th 03 05:45 PM
Too Basic A Question dave Excel Programming 6 October 26th 03 03:57 PM


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