新浪河的公式
不错,也提供两个公式,如图:
'如果第一行有批注,将批注删除后再运行
Sub 统计对错()
Dim R As Integer
Dim L As Integer
Dim w As Integer
Dim i As Integer
Dim intC, intW As Integer
Dim strDes As String
Dim xlsWs As New Worksheet100 '开始统计 *** 作 w = InputBox("请输入
要统计第几个工作表的内容:", , 1)
R = InputBox("请输入统计列:", , 1)
L = InputBox("请输入从第几行开始统计", , 1)
i = L
intC = 0: intW = 0
Set xlsWs = ThisWorkbookWorksheets(w)
Do While Not xlsWsCells(i, R) = ""
If xlsWsCells(i, R) = "√" Then
intC = intC + 1
ElseIf xlsWsCells(i, R) = "ⅹ" Then
intW = intW + 1
strDes = strDes + Chr(13) + Chr(10) + "第" + Trim(intW) + "次错误时已经第" + Trim(intC) + "次正确"
intC = 0
End If
i = i + 1 Loop ' *** 作技巧:生成第一个批注后,点右键,显示批注,选中批注,把批注拉大,然后生成其它批注,这样生成的批注都是
比较大的。
xlsWsCells(1, R)Select
SelectionAddComment
SelectionCommentText Text:=strDes If MsgBox("是否进行下一次统计?", vbYesNo) = vbYes Then GoTo 100
End Sub
评论列表(0条)