我正在使用以下代码将数据从导入的范围转换/排序到另一个范围。到目前为止一切正常,除了尝试运行代码时遇到以下错误:
运行时错误'91':对象变量或未设置块变量
此外,当我按下调试按钮时,它会将我发送到以下行:
rbuguri = ws.Range("A35:E999").Find("Verify Sweep / Regression").Row + 2
以下是我正在使用的代码:
Sub Transfer_VS_Bugs()
'
' Transfer_Bugs_To_Edit_Data Macro
Dim ws As Worksheet
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''' Change is needed '''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Set ws = ActiveWorkbook.Worksheets("VS")
ws.Select
Dim lrow As Integer
lrow = ws.Cells(Rows.Count, 1).End(xlUp).Row
startrow = 35
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
rbuguri = ws.Range("A35:E999").Find("Verify Sweep / Regression").Row + 2
cbuguri = ws.Range("B3:E32").Find("Summary").Column - 1
While startrow <= lrow
worksheet_EDIT_DATA.Cells(bugsrow, bugscolumn) = ws.Range("A" & startrow) 'for BUG ID
worksheet_EDIT_DATA.Cells(bugsrow, bugscolumn + 1) = ws.Range("B" & startrow) ' BUG Description
worksheet_EDIT_DATA.Cells(bugsrow, bugscolumn + 2) = ws.Range("D" & startrow) ' BUG Platform
startrow = startrow + 1
bugsrow = bugsrow + 1
Wend
ws.Activate
MsgBox "Copied, Formated and shipped" & vbNewLine & "Always remember to be carefull"
rbuguri = Nothing
cbuguri = Nothing
End Sub
那是什么原因?