以下是引用紫映竹在2008-1-19 22:18:00的发言:先谢谢大家,最后一个是用自定义做的?我今天晚上才看了一点? 那如果说还要对应后面的金额,如张二600、张三700、张六700(这是在一个单元格中),再如果是分别放在三列中,又要如何操作? 在一列中加上金额 Sub 计数() Dim intI As Integer, intJ As Integer, rowI As Integer Dim dobI As Double Dim strI As String dobI = 500 intJ = 1 rowI = Range("A65536").End(xlUp).Row For intI = 1 To rowI If Cells(intI, 2) > dobI Then If strI = "" Then strI = Cells(intI, 1) & Cells(intI, 2) Else strI = strI & "、" & Cells(intI, 1) & Cells(intI, 2) End If intJ = intJ + 1 End If Next Cells(1, 4) = intJ - 1 & "个 分别是:" & strI End Sub 放在三列中 Sub 计数() Dim intI As Integer, intJ As Integer, rowI As Integer Dim dobI As Double Dim strI As String dobI = 500 intJ = 1 rowI = Range("A65536").End(xlUp).Row For intI = 1 To rowI If Cells(intI, 2) > dobI Then Cells(1, intJ+3) = Cells(intI, 1) & Cells(intI, 2) intJ = intJ + 1 End If Next End Sub 出给题给你,你自己试着改一下代码 把结果放在最后一行,并且每个名字存放一列
[此贴子已经被作者于2008-1-19 23:06:12编辑过] |