Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I want to loop through each row, doing verious things, and
I need to stop at the last active row. I never know exactly how many rows are active. What VB reference do I use to get that number: For i = 1 to ?????? Do Stuff next i |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If you have data in the first row
For I = 1 To ActiveSheet.UsedRange.Rows.Count Or if you only test data in one column For I = 1 To ActiveSheet.Range("A" & Rows.Count).End(xlUp).Row -- Regards Ron de Bruin (Win XP Pro SP-1 XL2000-2003) www.rondebruin.nl "Bill Sturdevant" wrote in message ... I want to loop through each row, doing verious things, and I need to stop at the last active row. I never know exactly how many rows are active. What VB reference do I use to get that number: For i = 1 to ?????? Do Stuff next i |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Bill try something like this.
Dim rng as Long Set rng = Worksheets("sheet1").Cells(1,1).CurrentRegion for i = 1 to rng.rows.count '''' Do something ''' next i HTH Charle -- Message posted from http://www.ExcelForum.com |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
the following works. don't know if it's elegant or not
Set dataSheet = ActiveShee totalrows = dataSheet.UsedRange.Rows.Count |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Row select mode to highlight active row of active cell | Excel Discussion (Misc queries) | |||
referring to formula in a non active cell from active cell | Excel Discussion (Misc queries) | |||
HOW TO COPY 480 ACTIVE E-MAIL ADDRESSES CLM "G" ON AN ACTIVE EXCE. | Excel Discussion (Misc queries) | |||
Active X | Excel Programming | |||
Last Active | Excel Programming |