请教大家一个关于Excel VBA的问题~~

2024-11-27 11:49:06
推荐回答(3个)
回答1:

Dim i As Integer, SumCount As Integer
For i = 2 To [a65536].End(xlUp).Row
If Cells(i, 1).Value = TextBox1.Text Then
SumCount = SumCount + Cells(i, 2).Value
End If
Next i
TextBox2.Text = SumCount

回答2:

图片实在看不成,H!我吧

回答3:

给你个函数吧
你可以再C2中输入
=SUMPRODUCT(($A$2:$A$8=a2)*($B$2:$B$8))
就得到结果了