find the same entries and calculate sum
Ardus, you helped a lot.
I'm using your formula and doing it thru a program code.
The program in a system (not visible for a user) is openning and closing all
files (around 50) one by one. Before closing (as it's still opened) I'm using
the formula to copy the value in the different column:
If (Not IsNull(xlapp.VLookup(strProdName, rngContin, 10, False))) _
And (Not IsError(xlapp.VLookup(strProdName, rngContin, 10, False))) Then
varContin = xlapp.VLookup(strProdName, rngContin, 10, False)
num = xlapp.Match(strProdName, rngContin.Columns(1), 0)
Set rngOne = rngContin(num, 11)
rngOne.Value = varContin
If (Not IsNull(xlapp.SumIf(rngEquipA, strSpiral, rngEquipB))) _
And (Not IsError(xlapp.SumIf(rngEquipA, strSpiral, rngEquipB))) Then
intSpiralHrs = xlapp.SumIf(rngEquipA, strSpiral, rngEquipB) - 'here
is the formula
Set rngSpiral = rngContin(num, 15)
rngSpiral.Value = intSpiralHrs
End If
So, thanks a lot.
Now, I'm researching Dave's suggestions whether it's possible to substitute
the code with just a formula in a cell.
Best Regards,
Alex
"Ardus Petus" wrote:
Sorry: I misread your question.
Same by me: getting #VALUE error when WB is closed...
Seems like I can't help!
--
AP
"Alex" a écrit dans le message de
...
Thank you very much Ardus. It's working very well with opened (looked at)
workbook. But, as I said this searched workbook is closed and from the
sheet
where is this formula I'm getting #VALUE! in the cell.
Is it possible to use it with the closed searched workbook?
Thanks
"Ardus Petus" wrote:
=SUMIF(A1:A99,"B*",B1:B99)
HTH
--
AP
"Alex" a écrit dans le message de
...
I have the list of equipment in the column A and amounts in the
columnB in
the closed book as follow:
ColumnA ColumnB
F 10
B #1 20
C 10
B #2 15
D 20
...
on the another book I need to build some formula to get the sum of all
"B"
(dosn't matter whether it's "B #1" or "B #2").
Can anybody help me with this?
Thanks
|