python:如何在一个对象中增加列表

时间:2015-10-04 08:45:00

标签: python list

你能帮我找到问题吗?

我只是将对象添加到一个列表中,但似乎它出现在另一个列表中!

Sub SearchForSfb()

   Dim LSearchRow As Integer
   Dim LCopyToRow As Integer

   On Error GoTo Err_Execute

   'Start search in row 1
   LSearchRow = 1

   'Start copying data to row 2 in Open (row counter variable)
   LCopyToRow = 2

   While Len(Range("E" & CStr(LSearchRow)).Value) > 0

      'If value in column E = "word to be found", copy entire row to Open
      If Range("E" & CStr(LSearchRow)).Value = "word to be found" Then

         'Select row in Data to copy
         Rows(CStr(LSearchRow) & ":" & CStr(LSearchRow)).Select
         Selection.Copy

         'Paste row into SFB in next row
         Sheets("SFB").Select
         Rows(CStr(LCopyToRow) & ":" & CStr(LCopyToRow)).Select
         Sheets("SFB").Paste

         'Move counter to next row
         LCopyToRow = LCopyToRow + 1

         'Go back to Data to continue searching
         Sheets("Data").Select

      End If

      LSearchRow = LSearchRow + 1

   Wend

   'Position on cell A3
   Application.CutCopyMode = False
   Range("A3").Select

   MsgBox "All matching data has been copied."

   Exit Sub

Err_Execute:
   MsgBox "An error occurred."

End Sub

问题:为什么兄弟的相邻列表中有一个对象???

0 个答案:

没有答案