----------VB.NET 导出数据到EXCEL中------------- 在引用当中引入Microsoft Excel 11.0 Object Library Dim oExcel As New Excel.ApplicationDim obook As Excel.WorkbookDim oSheet As Excel.WorksheetDim DataArray(2000, 2000) As Integerobook = oExcel.Workbooks.Open("c:\1.xls")oSheet = obook.Worksheets(1)oSheet.Name = "ok"Dim myAdapter As New OleDb.OleDb...[ 查看全文 ]
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(sheets...[ 查看全文 ]