Home |
Search |
Today's Posts |
#1
|
|||
|
|||
[SOLVED] using the SUMIF function
Hello
I Have various data in column "E", and would like to put the result in each cell of column "F" Sub teste() Dim vResultado Dim LR As Long LR = Range("E" & Rows.Count).End(xlDown).Row vResultado = Application.SumIf(Range("A2:A3000"), Range("E3"), Range("B2:B3000")) Cells(LR + 1) = vResultado End Sub does anyone know how to do? Thank you! Last edited by elsg : May 23rd 12 at 01:43 AM |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
using the SUMIF function
Sub teste()
Dim vResultado Dim LR As Long LR = Range("E" & Rows.Count).End(xlUp).Row MsgBox LR vResultado = Application.WorksheetFunction.SumIf(Range("A2:A300 0"), _ Range("E3"), Range("B2:B3000")) MsgBox vResultado Range("E" & LR + 1) = vResultado End Sub Gord On Tue, 22 May 2012 10:22:48 +0000, elsg wrote: Hello I Have various data in column "E", and would like to put the result in each cell of column "F" Sub teste() Dim vResultado Dim LR As Long LR = Range("E" & Rows.Count).End(xlDown).Row vResultado = Application.SumIf(Range("A2:A3000"), Range("E3"), Range("B2:B3000")) Cells(LR + 1) = vResultado End Sub does anyone know how to do? Thank you! |
#3
|
|||
|
|||
Hi.
i'm solved this way. Sub Test() 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 Thank you!!! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to nest a left function within a sumif function? | Excel Worksheet Functions | |||
How do I use the TODAY function with the SUMIF function? | Excel Worksheet Functions | |||
SUMIF Function Inside SUMPRODUCT Function | Excel Worksheet Functions | |||
Can SUMIF function include AND function | Excel Worksheet Functions | |||
SUMIF - Range name to used for the "sum_range" portion of a SUMIF function | Excel Worksheet Functions |