Excel精英培训网

 找回密码
 注册
数据透视表40+个常用小技巧,让你一次学会!
查看: 4019|回复: 3

[已解决]怎样计算窗体列表中某列数值之和?

[复制链接]
发表于 2010-4-6 12:24 | 显示全部楼层 |阅读模式

怎样计算窗体列表中某列数值之和?

 

TrO0DxnR.rar (28.19 KB, 下载次数: 24)
excel精英培训的微信平台,每天都会发送excel学习教程和资料。扫一扫明天就可以收到新教程
发表于 2010-4-6 13:34 | 显示全部楼层    本楼为最佳答案   

你都会点击更新List了,这个应该不在话下啊。

Private Sub ListBox1_Click()
With UserForm2
    r = Me.ListBox1.ListIndex + 2
    i = .ListBox1.ListCount
    .ListBox1.AddItem .TextBox7.Text
    .ListBox1.List(i, 1) = .TextBox1.Text
    .ListBox1.List(i, 2) = Sheets("引用").Cells(r, 2)
    .ListBox1.List(i, 3) = Sheets("引用").Cells(r, 3)
    .ListBox1.List(i, 4) = Sheets("引用").Cells(r, 4)
    .TextBox8 = Val(.TextBox8) + Sheets("引用").Cells(r, 4)
 End With
End Sub

回复

使用道具 举报

 楼主| 发表于 2010-4-6 14:31 | 显示全部楼层

QUOTE:
以下是引用amulee在2010-4-6 13:34:00的发言:

你都会点击更新List了,这个应该不在话下啊。

Private Sub ListBox1_Click()
With UserForm2
    r = Me.ListBox1.ListIndex + 2
    i = .ListBox1.ListCount
    .ListBox1.AddItem .TextBox7.Text
    .ListBox1.List(i, 1) = .TextBox1.Text
    .ListBox1.List(i, 2) = Sheets("引用").Cells(r, 2)
    .ListBox1.List(i, 3) = Sheets("引用").Cells(r, 3)
    .ListBox1.List(i, 4) = Sheets("引用").Cells(r, 4)
    .TextBox8 = Val(.TextBox8) + Sheets("引用").Cells(r, 4)
 End With
End Sub

菜鸟很笨不会灵活应用和举一反三,故而需多看些例题来增加认识,幸亏有众多高手帮助和指点,非常感谢了!!

[em04]

回复

使用道具 举报

发表于 2015-1-12 12:49 | 显示全部楼层
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|Excel精英培训 ( 豫ICP备11015029号 )

GMT+8, 2024-5-16 23:51 , Processed in 0.278899 second(s), 11 queries , Gzip On, Yac On.

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表