首页 > 解决方案 > 错误运行时错误 -2147024809 (80070057)

问题描述

我对我的宏有一个问题,我在运行时遇到错误:

Run Time Error -2147024809 (80070057)

排队

If VBA.Len(Me.Controls("Textbox" & i).Value) > 0 Then

所有代码

Dim wks As Worksheet
Dim lWie As Long
Dim i As Long
Dim lRow As Long

Set wks = ThisWorkbook.Worksheets("Sheat1")

With wks
    lWie = .Cells(.Rows.Count, "A").End(xlUp).Row

    For i = 1 To 40
        If VBA.Len(Me.Controls("Textbox" & i).Value) > 0 Then
            lRow = lRow + 1
            .Cells(lWie + lRow, "A").Value = lWie + lRow - 1
            .Cells(lWie + lRow, "B").Value = .Range("P1").Value
            .Cells(lWie + lRow, "C").Value = .Range("R1").Value
            .Cells(lWie + lRow, "D").Value = Me.Controls("Textbox" & i).Value
        End If
    Next i
End With

标签: vba

解决方案


推荐阅读