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

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
Probably a rather basic question.... Eric @ BP-EVV Excel Programming 4 May 20th 08 07:55 PM
Basic VBA question... mattsvai[_7_] Excel Programming 8 February 3rd 06 07:53 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
Basic VBA question Henrik[_2_] Excel Programming 2 October 25th 03 12:23 AM


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