How could I have seen VBA, the data in column "A" no duplicates in the column "E" and the sum of these criteria in column "F".
See Attachment
Thank's
How could I have seen VBA, the data in column "A" no duplicates in the column "E" and the sum of these criteria in column "F".
See Attachment
Thank's
Last edited by marreco; 05-22-2012 at 07:57 AM.
"No xadrez nem sempre a menor dist?ncia entre dois pontos ? uma linha reta" G. Kasparov.
If your problem is solved, please say so clearly, and mark your thread as Solved: Click the Edit button on your first post in the thread, Click Go Advanced, select b from the Prefix dropdown, then click Save Changes. If more than two days have elapsed, the Edit button will not appear -- ask a moderator to mark it.
Hi use builtin function of excel in VAB
I think You can adjust it to your needs![]()
Sub aa() [f2] = Application.WorksheetFunction.SumIf([a2:a26], [e2], [b2:b26]) End Sub
![]()
Last edited by tom1977; 05-22-2012 at 07:53 AM.
Regards
tom1977
If You are satisfied with my solution click the small star icon on the left to say thanks.
Not so.
the code needs to go céluas of the column a "A" and see how many I have different data.
then he sends this reultado to column "E" is the code I have found that 3 data only ones he will return me the total of each column as one "F" under the column "E".
option
![]()
Sub ertert() Dim x, y(), i&, j&, k&, n&, s$ x = Range("A2:B" & Cells(Rows.Count, 1).End(xlUp).Row).Value ReDim y(1 To UBound(x), 1 To 2) On Error Resume Next With New Collection For i = 1 To UBound(x) s = Trim$(x(i, 1)) If Len(s) Then If IsEmpty(.Item(s)) Then k = k + 1: y(k, 1) = s: y(k, 2) = x(i, 2) .Add k, s Else n = .Item(s): y(n, 2) = y(n, 2) + x(i, 2) End If End If Next i End With If k > 1 Then [e2:f2].Resize(k).Value = y End Sub
It was great!
But is giving the end of the column "E" value of 633.4
in my case I do not have value.
can eliminate this part?
it can also comment on the code, I am grateful
try this
works only with ex>2007![]()
Sub bb() Dim lasta, laste As Long Dim nam, nam1, c As Range lasta = Cells(Rows.Count, 1).End(xlUp).Row Set nam = Range("a1:a" & lasta) nam.Copy [e1] nam.Offset(0, 4).RemoveDuplicates Columns:=1, Header:=xlYes laste = Cells(Rows.Count, 5).End(xlUp).Row Set nam1 = Range("e2:e" & laste) For Each c In nam1 c.Offset(, 1) = Application.WorksheetFunction.SumIf(nam, c, nam.Offset(0, 1)) Next End Sub
Look into your file column A row 64
Thank you!!!
thank you both!
Thank you very much!
Why do you want VBa for this?
In E2
In F2![]()
=LOOKUP(REPT("Z",255),CHOOSE({1;2},"",INDEX($A$2:$A$1000,MATCH(TRUE,INDEX(ISNA(MATCH($A$2:$A$1000,$E$1:$E1,0)),0),0))))
Drag/Fill both Down![]()
=IF(E2="","",SUMIF($A$2:$A$1000,E2,$B$2:$B$1000))
If you need any more information, please feel free to ask.
However,If this takes care of your needs, please select Thread Tools from menu above and set this topic to SOLVED. It helps everybody! ....
Also
اس کی مدد کرتا ہے اگر
شکریہ کہنے کے لئے سٹار کلک کریں
If you are satisfied by any members response to your problem please consider using the small Star icon bottom left of their post to show your appreciation.
If anyone can comment codes be very grateful!
nilem could you comment your code?
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks