• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

How to code this ?

sasuke

Member
how to code this guys?

Name A B C D
car 1 2 3 4
Jeep 2 2 3 4
Tren 4 1 1 1
car 1 1 2 1
Jeep 1 1 1 2

The answer must be :

car 1 2 3 4
car 1 1 2 1
CarResult 2 3 5 5 --->*sum if the same Name

Jeep 2 2 3 4
Jeep 1 1 1 2
JeepResult 3 3 4 6

Tren 4 1 1 1
TrenResult 4 1 1 1




Thanks for your help in Advanve :)
 
post data like below
a9 car
a10 jeep
a11 tren
and run below macro



[Sub sum()

For i = 9 To 11

Range("b" & i).Value = "=SUMIF($A$2:$A$6,A" & i & ",B2:B6)"
Range("c" & i).Value = "=SUMIF($A$2:$A$6,A" & i & ",c2:c6)"
Range("d" & i).Value = "=SUMIF($A$2:$A$6,A" & i & ",d2:d6)"
Range("e" & i).Value = "=SUMIF($A$2:$A$6,A" & i & ",e2:e6)"


Next
End Sub]
 
post data like below
a9 car
a10 jeep
a11 tren
and run below macro



[Sub sum()

For i = 9 To 11

Range("b" & i).Value = "=SUMIF($A$2:$A$6,A" & i & ",B2:B6)"
Range("c" & i).Value = "=SUMIF($A$2:$A$6,A" & i & ",c2:c6)"
Range("d" & i).Value = "=SUMIF($A$2:$A$6,A" & i & ",d2:d6)"
Range("e" & i).Value = "=SUMIF($A$2:$A$6,A" & i & ",e2:e6)"


Next
End Sub]
but not all the time have the same in cell, like B2:B6 to B2:B10
 
The thing about using formulas instead of code is that it is updated instantly without needing to push a button or have an event happen
 
Back
Top