Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
finding last row number of UsedRange
I want to loop through all the rows in my active worksheet's UsedRange. How
can I extract from the UsedRange Range object the numbers of the last row and column? Thanks everyone so much for your help--I really appreciate this community. Jamie |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
finding last row number of UsedRange
x = Cells.SpecialCells(xlCellTypeLastCell).Row
y = Cells.SpecialCells(xlCellTypeLastCell).Column HTH, Shockley "Jamie Martin" wrote in message ... I want to loop through all the rows in my active worksheet's UsedRange. How can I extract from the UsedRange Range object the numbers of the last row and column? Thanks everyone so much for your help--I really appreciate this community. Jamie |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
finding last row number of UsedRange
Last column number in range:
MyRange.Columns(MyRange.Columns.Count).Column Last row number in range MyRange.Rows(MyRange.Rows.Count).Row Bill Barclift "Jamie Martin" wrote in message ... I want to loop through all the rows in my active worksheet's UsedRange. How can I extract from the UsedRange Range object the numbers of the last row and column? Thanks everyone so much for your help--I really appreciate this community. Jamie |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
finding last row number of UsedRange
You don't really need the numbers...
Dim myRow As Range Dim myCell As Range With ActiveSheet.UsedRange For Each myRow In .Rows For Each myCell In Intersect(.Cells, myRow) 'Do something to the cell Next myCell Next myRow End With One way to get the last row and column: Dim lastRow As Long Dim lastCol As Integer With ActiveSheet.UsedRange lastRow = .Cells(.Count).Row lastCol = .Cells(.Count).Column End With In article , "Jamie Martin" wrote: I want to loop through all the rows in my active worksheet's UsedRange. How can I extract from the UsedRange Range object the numbers of the last row and column? Thanks everyone so much for your help--I really appreciate this community. Jamie |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
finding last row number of UsedRange
Thanks. It sounds like Perl should not be the only language whose motto is
"There's more than one way to do it." "J.E. McGimpsey" wrote in message ... You don't really need the numbers... Dim myRow As Range Dim myCell As Range With ActiveSheet.UsedRange For Each myRow In .Rows For Each myCell In Intersect(.Cells, myRow) 'Do something to the cell Next myCell Next myRow End With One way to get the last row and column: Dim lastRow As Long Dim lastCol As Integer With ActiveSheet.UsedRange lastRow = .Cells(.Count).Row lastCol = .Cells(.Count).Column End With In article , "Jamie Martin" wrote: I want to loop through all the rows in my active worksheet's UsedRange. How can I extract from the UsedRange Range object the numbers of the last row and column? Thanks everyone so much for your help--I really appreciate this community. Jamie |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Why is worksheet.usedrange empty? | Excel Worksheet Functions | |||
Real Value of .UsedRange.Rows.Count | Excel Worksheet Functions | |||
UsedRange problem | Excel Programming | |||
Find Usedrange question | Excel Programming | |||
Usedrange | Excel Programming |