|
本帖最后由 wbjiqpl 于 2018-9-23 13:01 编辑
请大神帮忙看一下以下代码,Cells(k + 1, 1) = ComboBox3.Text为什么不能赋值到单元格呢?LISTVIEW里的就可以。
Private Sub CommandButton6_Click()
On Error Resume Next
For I = 1 To ListView1.ListItems.Count
If ListView1.ListItems(I).Checked = True Then
With Sheet3
k = .Range("A65536").End(xlUp).Row
.Cells(k + 1, 1) = ComboBox3.Text
.Cells(k + 1, 5) = ListView1.ListItems(I).SubItems(1)
.Cells(k + 1, 6) = ListView1.ListItems(I).SubItems(2)
.Cells(k + 1, 7) = ListView1.ListItems(I).SubItems(3)
.Cells(k + 1, 8) = ListView1.ListItems(I).SubItems(4)
.Cells(k + 1, 9) = ListView1.ListItems(I).SubItems(5)
.Cells(k + 1, 10) = ListView1.ListItems(I).SubItems(6)
.Cells(k + 1, 11) = ListView1.ListItems(I).SubItems(7)
.Cells(k + 1, 12) = ListView1.ListItems(I).SubItems(8)
.Cells(k + 1, 13) = ListView1.ListItems(I).SubItems(9)
End With
End If
Next I
ListView1.ListItems.Clear
End Sub
|
|