Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi Everyone I really need help with this one, I've been looking for a solutio here, but am not getting anywhere. I have a sheet that is populated with data from another sheet. The dat is categorized into sectors in the target sheet. The program then need to give a subtotal of all the records in the range. The table in th sheet looks like this: Code ------------------- 3. Frequency: Suburbs Suburb Street Total Sector 1 Basia Scukum 1 Wellington Sk 1 subtotal Sector 2 Davie Kannerie 1 Kuyler Lamini 2 subtotal Sector 3 Overaim Fouche 1 subtotal ------------------- The code I have in VBA is as follows and for some reason gives me th wrong value in the third sector: Code ------------------- Sheet11.Activate Range("A14").Select Do While ActiveCell.Value < "Total" If ActiveCell.Value < "" Then ActiveCell.Offset(1, 0).Activate Else ActiveCell.Offset(0, 2).Select ActiveCell.Font.Bold = True ActiveWorkbook.Names.Add Name:="startsum", RefersTo:=ActiveCell Range(ActiveCell, ActiveCell.Offset(-1, 0).End(xlUp)).Select ' I'm thinking that my problem is here with the selection of the cells to total. Range("startsum").Value = Application.Sum(Selection) Range("startsum").Select ActiveCell.Offset(0, -2).Select ActiveCell.Offset(1, 0).Activate End If Loo ------------------- -- popp ----------------------------------------------------------------------- poppy's Profile: http://www.excelforum.com/member.php...fo&userid=1145 View this thread: http://www.excelforum.com/showthread.php?threadid=37677 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
"Center across selection" rather than "Merge cells" | Excel Discussion (Misc queries) | |||
Range or Selection Divided by "1000" | Excel Discussion (Misc queries) | |||
Icon for "Wrap" and for "Centre Across Selection" | Excel Worksheet Functions | |||
Using "Cells" to write "Range("A:A,H:H").Select" | Excel Programming |