excel 获取LISTVIEW列表中的数据
时间:2022-08-08 14:05:42
‘LISTVIEW1中有13列
‘因为LISTVIEW1中的所有数据,有可能是通过筛选得来的,可能通过搜索得来的
‘所以在这里将显示在LISTVIEW1中的数据写入数组ARR中,方便处理这些数据
Dim arr
With ListView1
ReDim arr(1 To .ListItems.Count, 1 To 13)
For i = 1 To UBound(arr, 1) ‘遍历所有LISTVIEW1数据的行,用 For i = 1 To .ListItems.Count 也可以
arr(i, 1) = .ListItems(i).Text ‘第一列不一样,无法通过循环得到,只好单取
For j = 2 To 13 ‘遍历第i行的所有列的数据,共13列,第1列数据已取,从第2列开始
arr(i, j) = .ListItems(i).ListSubItems(j – 1).Text ‘将i行其他列写入数组中
Next
Next
End With
标签:写入,得来,数据,遍历,Excel函数
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
excel带单位的数据怎么求和?
2023-04-13 04:53:44
![](https://img.aspxhome.com/file/2023/7/a139967_0s.gif)
如何在Word里添加文字水印
2023-04-14 06:59:54
![](https://img.aspxhome.com/file/2023/5/34915_0s.jpg)
excel2019怎么排序?excel2019排序教程
2022-12-31 04:01:12
![](https://img.aspxhome.com/file/2023/1/40031_0s.jpg)
WPS2016文字中如何直接计算算式
2023-08-25 06:27:17
win10系统的报错日志如何查看?
2023-08-13 03:36:19
![](https://img.aspxhome.com/file/2023/3/46913_0s.jpg)
Win10组策略如何打开?
2023-11-25 20:48:21
![](https://img.aspxhome.com/file/2023/9/51069_0s.png)
怎样在Word2013页面视图中显示背景色
2023-12-12 15:30:03
![](https://img.aspxhome.com/file/2023/8/20778_0s.jpg)
excel表格排序的方法
2023-03-16 13:24:09
Excel表格身份证号显示不全怎么办?比较长数字显示不全解决方法
2023-02-17 14:35:40
![](https://img.aspxhome.com/file/2023/7/a141777_0s.jpg)
Acrobat PDF编辑器怎么开启单页视图模式?
2023-07-26 04:48:55
![](https://img.aspxhome.com/file/2023/1/15251_0s.jpg)
Word2007文档自动保存位置和技巧
2023-11-20 08:21:05
![](https://img.aspxhome.com/file/2023/2/18072_0s.jpg)
如何用excel制作一个,可以每天追踪任务已用时间的甘特图?-excel教程
2022-01-28 07:46:49
怎么给Excel表格添加水印
2023-08-22 18:42:18
![](https://img.aspxhome.com/file/2023/6/a140086_0s.jpg)
Word表格操作常用的键盘快捷键总结
2023-10-21 22:26:14
![](https://img.aspxhome.com/file/2023/5/28995_0s.jpg)
清除Excel单元格格式的几种方法
2022-02-10 13:10:13
![](https://img.aspxhome.com/file/2023/9/a156639_0s.jpg)
excel2007表格中如何插入和编辑剪贴画
2022-02-01 09:25:40
![](https://img.aspxhome.com/file/2023/9/a140389_0s.jpg)
Word中文字重叠在一起怎么办 Word中文字重叠在一起解决办法
2022-03-07 22:32:52
![](https://img.aspxhome.com/file/2023/2/34072_0s.jpg)
如何提高win7硬盘性能的ahci功能?
2022-09-26 15:25:25
![](https://img.aspxhome.com/file/2023/6/53126_0s.png)
Excel中用if函数计算阶梯式工资提成操作详解
2023-04-16 08:29:10
![](https://img.aspxhome.com/file/2023/6/a153456_0s.jpg)
Excel中一键套用格式的操作方法
2022-10-29 13:03:49