Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I've a 1000 number entries (i.e n = 1000). I want to sum then in tens, that
is, 1-10, 2-11, 3-12,...990-1000). I want to do this using excel macro. Please will somebody write the code for me? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
In you first output cell enter
=SUMPRODUCT(--(ROW($A$1:$A$1000)(ROW(A1)-1)*10),--(ROW($A$1:$A$1000)<=ROW(A 1)*10),$A$1:$A$1000) and copy down until you run out -- HTH RP (remove nothere from the email address if mailing direct) "EFFY" wrote in message ... I've a 1000 number entries (i.e n = 1000). I want to sum then in tens, that is, 1-10, 2-11, 3-12,...990-1000). I want to do this using excel macro. Please will somebody write the code for me? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
that
is, 1-10, 2-11, 3-12,...990-1000). That does 1 - 10 11 - 20 not 1 - 10 2 - 11 3 - 12 =sum(A1:A10) and copy down. would be the formula solution, although the OP asked for a macro. -- Regards, Tom Ogilvy "Bob Phillips" wrote in message ... In you first output cell enter =SUMPRODUCT(--(ROW($A$1:$A$1000)(ROW(A1)-1)*10),--(ROW($A$1:$A$1000)<=ROW(A 1)*10),$A$1:$A$1000) and copy down until you run out -- HTH RP (remove nothere from the email address if mailing direct) "EFFY" wrote in message ... I've a 1000 number entries (i.e n = 1000). I want to sum then in tens, that is, 1-10, 2-11, 3-12,...990-1000). I want to do this using excel macro. Please will somebody write the code for me? |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Assume you values are in A1:A1000 then
Sub SumByTen() Dim i As Long, j As Long j = 10 For i = 1 To 991 Cells(j, 2).Value = Application.Sum(Cells(i, 1).Resize(10)) Cells(j, 3).Value = "'" & i & " - " & i + 9 j = j + 1 Next End Sub The last sum would be 991 to 1000, not 990 to 1000 -- Regards, Tom Ogilvy "EFFY" wrote in message ... I've a 1000 number entries (i.e n = 1000). I want to sum then in tens, that is, 1-10, 2-11, 3-12,...990-1000). I want to do this using excel macro. Please will somebody write the code for me? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
writing macro | New Users to Excel | |||
Macro Writing | Excel Programming | |||
Macro Writing | Excel Programming | |||
Macro Writing Help? | Excel Programming | |||
Writing Macro | Excel Programming |