首页 > 解决方案 > 当匹配之一是日期( VBA )时具有多个匹配(循环)的索引 - 值不匹配

问题描述

嗨,我正在尝试首先通过列进行索引匹配循环,然后在 VBA 中使用多个条件进行行

我的源数据如下:

日期 email-ID 考勤状态

和目的地数据,如:

电子邮件 ID 日期 1 日期 2 日期 3

我在哪里使用带有工作表功能的代码

.With Destination
.Range("B2:D4").Clear
For R = 2 To 4
For C = 2 To UBound(Arr2, 2)

.Cells(R, C) = 

.Application.WorksheetFunction.Index(Source. Range("A2:C30000"),.Application.WorksheetFunction.Match(.Cells   R, 1) & CDate(.Cells(1, C)), WS1.Range("B2:B30000") & WS1.Range("A2:A30000"), 0), 3)


Next C


Next R
.Activate
End With


End Sub

它给了我类型不匹配错误。有什么帮助吗?

我在 Mac 上使用 Excel 2016。

标签: excelvbaindexingmatchexcel-2016

解决方案


推荐阅读