gpt4 book ai didi

vba - VBA匹配和查找错误: No matching type & Undefined Error

转载 作者:行者123 更新时间:2023-12-03 08:52:55 25 4
gpt4 key购买 nike


    n = Worksheets("Datasheet").UsedRange.Rows.count
For l = 2 To k
check = Application.Find(Worksheets("AFAS Dump").Cells(l, 1), Worksheets("Datasheet").Range("K4:K10000000"))
If check = 0 Then
Cells(n + 1, 1) = Worksheets("AFAS Dump").Cells(l, 13)
End If
Next l

AFAS Dump column 1 contains an amount of nr's. Datasheet also contains an amount of nr's. I want to check whether a nr from AFAS dump is also in Datasheet. If not I want to add that nr to datasheet. I want to use Match or Find but they both give me problems.



另一件事是我的K10000000,我希望通过一个参数来更改nr,但是我注意到它不起作用。我更喜欢将e分配给值的Ke。

最佳答案

尚不清楚您要实现的目标,因为您在其中一行中引用了Column 13,而在尝试添加到Column K时这没有意义。如果要宏检查“AFAS转储”表中Column 1中的数字是否在“数据表”的Column K中,如果尚未存在,请将其添加到“数据表”的底部,然后尝试以下操作:

n = Worksheets("Datasheet").Cells(Rows.Count,11).End(xlup).Row
e = Worksheets("AFAS Dump").Cells(Rows.Count,1).End(xlup).Row
For l = 2 To e
If Worksheetfunction.Match(Worksheets("AFAS Dump").Cells(l, 1), _
Worksheets("Datasheet").Range("K4:K" & n),0) = 0 Then
Worksheets("Datasheet").Cells(n + 1, 11) = Worksheets("AFAS Dump").Cells(l, 1)
n = n + 1
End If
Next l

关于vba - VBA匹配和查找错误: No matching type & Undefined Error,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36129885/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com