Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hello. I think it's simple problem but as newbee in VBA it's a big one for me. First an example how my table could look like: (I used simple numbers for the example, nomally these numbers are calculated with several fomulars) SET1 20 40 20 SUM: 80 SET2 20 30 SUM: 50 SET3 30 SUM: 30 The sum of every set should be calculated automatically with a formular. Not a big deal but the problem is the following: You can add new numbers in every Set with a makro. Therefore I don't know how many rows I have to use to calculate the sum. I need a script which sums all the rows between the beginning and the end of every single set. The calculation of the sum should also work, if you delete one row or number. Thank you for any help in advance. cheers Stefan -- skoller ------------------------------------------------------------------------ skoller's Profile: http://www.excelforum.com/member.php...o&userid=32388 View this thread: http://www.excelforum.com/showthread...hreadid=521522 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() n=0 For i = 1 to Cells(Rows.Count,"A").End(xlUp).Row If Cells(i,"A").Value = "" Then Cells(i,"A").Value = n Else If Left(Cells(i,"A").Value,3) < "SET" Then n = n + Cells(i,"A").Value End If End If Next i -- HTH Bob Phillips (remove nothere from the email address if mailing direct) "skoller" wrote in message ... Hello. I think it's simple problem but as newbee in VBA it's a big one for me. First an example how my table could look like: (I used simple numbers for the example, nomally these numbers are calculated with several fomulars) SET1 20 40 20 SUM: 80 SET2 20 30 SUM: 50 SET3 30 SUM: 30 The sum of every set should be calculated automatically with a formular. Not a big deal but the problem is the following: You can add new numbers in every Set with a makro. Therefore I don't know how many rows I have to use to calculate the sum. I need a script which sums all the rows between the beginning and the end of every single set. The calculation of the sum should also work, if you delete one row or number. Thank you for any help in advance. cheers Stefan -- skoller ------------------------------------------------------------------------ skoller's Profile: http://www.excelforum.com/member.php...o&userid=32388 View this thread: http://www.excelforum.com/showthread...hreadid=521522 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Thank you for the quick reply.:) -- skoller ------------------------------------------------------------------------ skoller's Profile: http://www.excelforum.com/member.php...o&userid=32388 View this thread: http://www.excelforum.com/showthread...hreadid=521522 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
MATCH an unknown number | Excel Discussion (Misc queries) | |||
Formula's dealing with unknown number of rows | Excel Discussion (Misc queries) | |||
Unknown Rows | Excel Discussion (Misc queries) | |||
Deleting 3 rows when current row number is unknown | Excel Programming | |||
Summing unknown number of rows | Excel Programming |