|
求助,运行此代码总是显示数据类型错误,不知道哪里错了,麻烦各位大神帮帮忙,如何能够运行此代码
Sub 提取数据刘一()
Dim Filename As String
Workbooks.Open Filename:="C:\Users\Susan_OOO\Desktop\区域每日报表\刘一.xlsx"
With Worksheets("sales")
Worksheets("sales").Cells.Clear
End With
Dim arr, brr
Dim k As String, i As Long, j As Long
arr = Sheets("SALES").Range("A1").CurrentRegion: k = 1
ReDim brr(1 To UBound(arr), 1 To UBound(arr, 2))
For i = 1 To UBound(arr)
If arr(i, 14) = "刘一" Then
k = k + 1
For j = 1 To UBound(arr, 2)
brr(k, j) = arr(i, j)
Next
End If
Next
Sheets("sales").Range("a1").Resize(UBound(arr), UBound(arr, 2)) = brr
Workbooks("刘一.xlsx").Close True
End Sub
|
|