VBA代码错误,说明未设置对象变量

时间:2018-09-27 10:49:22

标签: vba object runtime-error

我正在使用以下代码将数据从导入的范围转换/排序到另一个范围。到目前为止一切正常,除了尝试运行代码时遇到以下错误:

  

运行时错误'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

那是什么原因?

0 个答案:

没有答案