Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
just as a question: Why not use the feature 'Data - Subtotals' -- Regards Frank Kabel Frankfurt, Germany Federico Ginnari wrote: Hi, i'm stuck in a little project that i'm working on, the problem is that i can't get my nested loop to work as i wanted, here is an example of the information on the sheet, and below is an example of my code. Title $$$$ $$$$ $$$$ $$$$ TOTAL Title $$$$ $$$$ $$$$ $$$$ TOTAL lngTotalRows = Sheet1.UsedRange.Rows.Count Dim L as long Dim Lo As Long L = 12 Lo = 16 For L = L To lngTotalRows If Cells(L, 1).Text < "" Then For Lo = Lo To lngTotalRows If Cells(Lo, 1).Text < "" Then Cells((Lo - 1), 8) = WorksheetFunction.Sum(Range(Cells(L, 8), Cells(Lo, 8))) End If Next Lo End If Next L the idea for this loop is to give me the total for each title, the problem with this code is that the range is not being updated correctly, the first position for the range always stays on the same place, also because on the way that the loop works, i'm not getting a total for the last title, how can i overcome this problem?, or is there an easier way to do this? what i'm missing? help!!, if anyone needs more information please let me know, thanks in advance |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Nested If Loop Limitation for Excel 2003 | Excel Discussion (Misc queries) | |||
Nested loop | Excel Worksheet Functions | |||
Nested Loop Link | Excel Worksheet Functions | |||
HELP!!!! Can't stop a loop (NOT an infinite loop) | Excel Programming | |||
Nested loop with ranking | Excel Programming |