在EXCEL中获取列中不重复的值的个数
所属类别:.NET
文章作者:未知
特别推荐:免费发布信息 承包关键词~~抢爆了!HOT!
Public Sub distinctCount()'求Col列中StartRow到EndRow范围中不重复的个数'本例是计算标题为sheet1的Excel表中的A1:A240的不重复值的个数 '修改下面四行的结尾值 Dim sheetsCaption As String: sheetsCaption = "Sheet1" Dim Col As String: Col = "A" Dim StartRow As Integer: StartRow = 1 Dim EndRow As Integer: EndRow = 240 '以下固定 Dim Count As Integer: Count = 0 With Sheets(sheetsCaption) For i = StartRow To EndRow Count = Count + 1 For j = StartRow To i - 1 If .Range(Col & i) = .Range(Col & j) Then Count = Count - 1 Exit For End If Next Next End With MsgBox CountEnd Sub关闭本页
相关信息· asp对象化之:基于adodb.stream的文件操作类
· 三种办法解决IE浏览器突然关闭
· 系统小贴士:加快Linux操作系统启动速度
· JSP自定义标签快速入门
85718
56186
