|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
- Private Sub UserForm_Initialize()
- Dim Arr, i&
- With ListView1.ColumnHeaders
- .Add , , "编码"
- .Add , , "物品名称", Width / 4
- .Add , , "规格型号", Width / 8, lvwColumnCenter
- .Add , , "单位", Width / 8, lvwColumnCenter
- .Add , , "设定单价", Width / 8
- .Add , , "二科目", Width / 8
- .Add , , "三科目", Width / 8
- .Add , , "供货商", Width / 8
- End With
- ListView1.View = lvwReport
- ListView1.Sorted = True
- ListView1.SortKey = 0
- ListView1.Gridlines = True
- ListView1.FullRowSelect = True
- Label2.Caption = ""
- Label3.Caption = ""
- Arr = Sheet1.[a1].CurrentRegion
- With Sheet1
- For i = 2 To UBound(Arr)
- Set ITM = ListView1.ListItems.Add()
- ITM.Text = Arr(i, 1)
- ITM.SubItems(1) = Arr(i, 2)
- ITM.SubItems(2) = Arr(i, 3)
- ITM.SubItems(3) = Arr(i, 4)
- ITM.SubItems(4) = Format(Arr(i, 5), "#,##0.00")
- ITM.SubItems(5) = Arr(i, 6)
- ITM.SubItems(6) = Arr(i, 7)
- ITM.SubItems(7) = Arr(i, 8)
- Next i
- End With
- Label2.Caption = "共找到 " & ListView1.ListItems.Count & " 条记录"
- TextBox1.SetFocus
- End Sub
复制代码 |
|