通过数组查看将值分配到单元格中

时间:2017-03-26 13:42:57

标签: excel vba excel-vba

我有如下所示的2d阵列。从1-26开始有26个值,但是"更大"类别,例如第二个值:"重要","非常重要","非常重要",并且都被归类为"检查"。

我可以将其集成到此数组中,例如在重要之后添加:important(1,3)?或者(2,3)对不起,我从Arrays开始......我还没完全明白这一点。然后我想要填充到列中的值。例如,如果column = 1则column2 =" Important"和column3 ="检查"等等。

Dim Priority(1 To 26, 1 To 2)
Priority(1, 1) = 1: Priority(1, 2) = "Important"

1 个答案:

答案 0 :(得分:0)

  For Each Zelle In Range(Cells(FirstRow + 2, 14), Cells(LastRow, 14))
   Zelle.Offset(0, 1) = Application.VLookup(Zelle, Priority, 3, False)
   Zelle.Value = Application.VLookup(Zelle, Priority, 2, False)
   'Zelle = IIf(IsError(Zelle), "???", "Zelle")
    Next Zelle

它检查CellX,然后直接转到CellX + 1等等......我相信这也可以用For i Loop完成

相关问题