在VBA中获取.MoveLast语句的自动化错误

时间:2018-10-25 12:15:06

标签: excel vba excel-vba

在下面的VBA脚本中获取.MoveLast语句的自动化错误。

    CursorLocation = adUseClient
    Dim rngDst As Range
    Set rngDst =ThisWorkbook.Sheets("ALM_Scenario_Detailed_Temp").Range("A2")
    With mrs
                If Not .BOF And Not .EOF Then
                    .MoveLast
                    .MoveFirst
                    While Not .EOF
                        For i = 0 To .Fields.Count - 1
                            rngDst.Offset(, i) = .Fields(i).Value
                        Next i
                        mrs.MoveNext
                        Set rngDst = rngDst.Offset(1)
                    Wend
                End If
            End With

0 个答案:

没有答案