摘要: Sub 测试数组的常见操作() Dim arr() Dim totalR As Integer totalR = Range("A65536").End(xlUp).Row '值为12 arr = Range(Cells(1, 1), Cells(totalR, 2)).Value '共12行 Debug.Print LBound(arr) '值为1 Debug.Print UBound(arr) '值为12 '通过水平转置,可以将数据原为两列,改为两行.也证明了arr数组默认为列. '将整个数组经水平转置后赋值给相同范围的单 阅读全文
posted @ 2010-05-11 12:04 surfacetension 阅读(732) 评论(0) 推荐(0) 编辑
摘要: Sub 字典功能应用() Dim i As Integer, arr() Dim dic As Object, wb As Object Dim kl As Integer For kl = 1 To 2 Set wb = GetObject(ThisWorkbook.Path & "\汇总数据调整格式版.xls") ‘数据源 With wb.Sheets("sheet1") i = .Range("A65536").End(xlUp).Row arr = .Range("A1").Resize(i, 2) 阅读全文
posted @ 2010-05-11 12:04 surfacetension 阅读(280) 评论(0) 推荐(0) 编辑