|
发表于 2017-8-16 08:42
|
显示全部楼层
本楼为最佳答案
- Private Sub CommandButton2_Click()
- Dim 批号
- Set lv = ListView1
- For a = 1 To lv.ListItems.Count
- Set itm = lv.ListItems(a)
- 批号 = Left(itm.SubItems(1), 2) '取(批次)前2位值
- If 批号 = "FY" Or 批号 = "XS" Then
- ComboBox1 = 批号
- With Sheets(批号)
- i = .[a65536].End(3).Row + 1
- .Cells(i, 1) = itm.Text
- .Cells(i, 2) = itm.SubItems(1)
- .Cells(i, 3) = itm.SubItems(2)
- .Cells(i, 4) = itm.SubItems(3)
- End With
- End If
- Next a
- End Sub
复制代码 |
|