Home |
Search |
Today's Posts |
#9
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Feb 19, 3:28 am, "merjet" wrote:
Sub DoSums() Dim sSubTotal As Single Dim sTotal As Single Dim ws As Worksheet Dim iRow As Integer Set ws = Sheets("Sheet1") iRow = 10 Do Do sSubTotal = sSubTotal + ws.Cells(iRow, 2) sTotal = sTotal + ws.Cells(iRow, 2) iRow = iRow + 1 Loop Until ws.Cells(iRow, 1) = "" ws.Cells(iRow, 2) = sSubTotal sSubTotal = 0 Loop Until ws.Cells(iRow, 1) = "" And ws.Cells(iRow + 1, 1) = "" ws.Cells(iRow, 2) = sTotal End Sub Hth, Merjet Thnk u Merget. It has been whole day trying to figure out and I have to get the formula placed bcos every time the staff wont be running the procedure. Once the group of tanks are changed I want to put the formulas automatically thro VB. The problem is to put down exactly what I want. I will take another shot tomoro and ur code is totally different from the one i hv been trying. Will try yours too to see what it does. let me try one more time to explain to u in a different way.\ out of 24 tanks-- i might be asked load cargo into groups. So one time it might be all the 24 tanks as one group. Then I have to have only one total . Some time they might say load in 2 groups. then I hv to split 24 tanks into two groups of say 10 tanks and 14 tanks. In this case i need to have sub totals of each group and grand total of group1 and group2. Like this they may say load in 4 groups. Then I might need sub totals and grand total accly. So if u can take time to see my first post where I have mentioned the way I require to be done. Mr Bob has sugested the code. Only drawback is he is presuming that the cells below are empty. I have other data below b40 and hence using xldown or last cell does not work bcos it goes another may be 50 cells down bcos of data about 3 rows below b40. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Multi-Level Category Labels | Charts and Charting in Excel | |||
How do I format multi-level category labels | Charts and Charting in Excel | |||
Multi level category labels | Excel Discussion (Misc queries) | |||
Multi-Level Category Gridlines | Charts and Charting in Excel | |||
representing multi category in a column chart | Charts and Charting in Excel |