|
Sub mywrite() With Me.ListView1 If .ListItems.Count = 0 Then Exit Sub .ListItems(1).Ghosted = False iRow = Application.Max(3, ActiveSheet.[b65536].End(xlUp).Row) '最大行数 For i = 1 To .ListItems.Count If .ListItems(i).Checked Then iRow = iRow + 1 .ListItems(i).Checked = False With ActiveSheet '************************************************************************该下方处修改**************** ' .Cells(iRow, 2).Offset(0, 0) = ListView1.SelectedItem.Text ' .Cells(iRow, 2).Offset(0, 1) = ListView1.SelectedItem.SubItems(1) ' .Cells(iRow, 2).Offset(0, 2) = ListView1.SelectedItem.SubItems(2) ' .Cells(iRow, 2).Offset(0, 3) = ListView1.SelectedItem.SubItems(3) .Cells(iRow, 2).Offset(0, 0) = ListView1.ListItems(i).Text .Cells(iRow, 2).Offset(0, 1) = ListView1.ListItems(i).SubItems(1) .Cells(iRow, 2).Offset(0, 2) = ListView1.ListItems(i).SubItems(2) .Cells(iRow, 2).Offset(0, 3) = ListView1.ListItems(i).SubItems(3) '************************************************************************该上方处修改**************** End With End If Next i End WithUnload MeEnd Sub
|
|