![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Mar 2002
Posts: 38
|
I am looking at some VBA code in an excel macro, and I was hoping that someone could explain to me what UsedRange is.
The particular line of code is: Set Rng = ActiveSheet.UsedRange.Rows |
|
|
|
|
|
#2 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Columbus, OH, USA
Posts: 3,519
|
UsedRange returns a rectangular range which goes from the upper left populated cell in the spreadsheet, to the lower right populated cell.
e.g. if A1 has "1" in it and C6 has "4" in it, the used range will return the range "A1:C6". |
|
|
|
|
|
#3 |
|
New Member
Join Date: Mar 2002
Posts: 38
|
Thanks a bunch, that helped.
|
|
|
|
|
|
#4 | |
|
Join Date: Apr 2002
Posts: 12
|
Quote:
The top left and bottom right cells of the used range are not necessarily populated. The top left cell is the intersection of the first used column and the first used row. The bottom right cell is the intersection of the last used column and the last used row. |
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|