匹配函数Excel VBA中的相对单元格引用

为什么我不能在匹配函数中使用相对单元格引用? 如果我使用绝对单元格引用,这将按预期工作,但是,我需要excel移动到下一行,并在范围内评估每个单元格。 例如,第一次迭代比较B29,下一次迭代比较B30,下一次迭代评估B31,等等。 请帮忙!

Sub Test() For Each cell In Worksheets("Sheet1").Range("F29:F50") If Not IsError(Application.Match(RC[-3], Range("Interior_Lining_Scuffs_Floors"), 0)) Then cell.Value = "Interior Lining/Scuffs/Floors" End If Next 

你可以使用这个:

 For Each cell In Worksheets("Sheet1").Range("F29:F50") If Not IsError(Application.Match(cell.Offset(,-3), Range("Interior_Lining_Scuffs_Floors"), 0)) Then cell.Value = "Interior Lining/Scuffs/Floors" End If Next