如何利用Excel进行商场销售管理?????

来源:百度知道 编辑:UC知道 时间:2024/06/10 14:18:17
VBA代码:汇总代码,单价代码

要注意产品的种类有多少!!!!!!!!!!!!!
Sub huizong()
s1 = 0: s2 = 0: s3 = 0: s4 = 0: s5 = 0
For i = 3 To 13
If Left(Cells(i, 3), 2) = "彩电" Then s1 = s1 + Cells(i, 6)
If Left(Cells(i, 3), 2) = "空调" Then s2 = s2 + Cells(i, 6)
If Left(Cells(i, 3), 3) = "微波炉" Then s3 = s3 + Cells(i, 6)
If Left(Cells(i, 3), 3) = "热水器" Then s4 = s4 + Cells(i, 6)
If Left(Cells(i, 3), 3) = "洗衣机" Then s5 = s5 + Cells(i, 6)
Next i
Range("f15") = s1
Range("f16") = s2
Range("f17") = s3
Range("f18") = s4
Range("f19") = s5
End Sub
Function danjia(x)
If x = "彩电V1" Then danjia = 3200
If x = "彩电V2" Then danjia = 4500
If x = "彩电V3" Then danjia = 5800
If x = "空调V1" Then danjia = 1200
If x = "空调V2" Then danjia = 880
If x = "空调V3" Then danjia = 780
If x = "微波