Sub APnumbers()
Dim i, Strnglen, Lastcell As Integer
Dim ws As Worksheet
Dim Currentcell As Range
Set ws = ActiveWorkbook.Sheets(2)
Lastcell = Range("AX1048556").End(xlUp).Row
For i = 4 To Lastcell
Set Currentcell = ActiveSheet.Range("BA" & i)
PACN= Currentcell.Value
Pnoposition = InStr(1, PACN, "1")
Pvalue = Mid(PACN, Pnoposition, 8)
With ws
.Range("AY" & i).Value = Pvalue
End With
End Sub
这里在第3行最后一行我得到一个应用程序定义或对象定义错误。你可以帮忙吗?