Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have data in a worksheet.
I have two rows between each of my lines of data. What I need is a macro to insert a sum calculation for everything above until the last sum calculation. The numbers are contained in column A I hope this makes sense. Thanks Andrea |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You have something like this
1 5 2 6 3 =sum(a1:a2) 4 5 7 6 8 7 =sum(A3:a6) 8 9 35 10 36 11 =sum(a7:a10) if you copy =sum(a3:a6) and past it in all the first blank rows it will automatically increment to meet your requirements. " wrote: I have data in a worksheet. I have two rows between each of my lines of data. What I need is a macro to insert a sum calculation for everything above until the last sum calculation. The numbers are contained in column A I hope this makes sense. Thanks Andrea |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I wanted a macro to do this automatically.....
Rather than me do it manually..... Thanks Andrea On 31 May, 12:49, Joel wrote: You have something like this 1 5 2 6 3 =sum(a1:a2) 4 5 7 6 8 7 =sum(A3:a6) 8 9 35 10 36 11 =sum(a7:a10) if you copy =sum(a3:a6) and past it in all the first blank rows it will automatically increment to meet your requirements. " wrote: I have data in a worksheet. I have two rows between each of my lines of data. What I need is a macro to insert a sum calculation for everything above until the last sum calculation. The numbers are contained in column A I hope this makes sense. Thanks Andrea- Hide quoted text - - Show quoted text - |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try this
Sub copysum() EndRow = Cells(Rows.Count, "A").End(xlUp).Row FirstRow = 1 RowCount = 1 Do While RowCount <= EndRow + 1 If IsEmpty(Cells(RowCount, "A")) Then LastRow = RowCount - 1 Cells(RowCount, "A").FormulaR1C1 = _ "=SUM(R" & CStr(FirstRow) & "C1:R" & _ CStr(LastRow) & "C1)" FirstRow = RowCount RowCount = RowCount + 1 End If RowCount = RowCount + 1 Loop End Sub " wrote: I wanted a macro to do this automatically..... Rather than me do it manually..... Thanks Andrea On 31 May, 12:49, Joel wrote: You have something like this 1 5 2 6 3 =sum(a1:a2) 4 5 7 6 8 7 =sum(A3:a6) 8 9 35 10 36 11 =sum(a7:a10) if you copy =sum(a3:a6) and past it in all the first blank rows it will automatically increment to meet your requirements. " wrote: I have data in a worksheet. I have two rows between each of my lines of data. What I need is a macro to insert a sum calculation for everything above until the last sum calculation. The numbers are contained in column A I hope this makes sense. Thanks Andrea- Hide quoted text - - Show quoted text - |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to insert a slash into a blank cell | New Users to Excel | |||
if cell is blank insert a zero | Excel Discussion (Misc queries) | |||
Insert blank row above populated cell | Excel Programming | |||
Insert Blank Line after the Word Category is found | Excel Programming | |||
insert blank row when cell changes | Excel Programming |