作为评估函数中的数字列

我想在vba中使用下面的代码:

Dim negocio As String Dim feeder As String Dim origenAWB As String Dim destinoAWB As String Set WS = ActiveSheet negocio = Cells(6, 6).Value feeder = Cells(8, 6).Value origenAWB = Cells(10, 6).Value destinoAWB = Cells(12, 6).Value For i = 1 To 53 WS.Cells(24, 1 + i) _ = Sheets("Proyeccion").Evaluate("=INDEX(6+i,(MATCH(1,(B:B=""" & negocio & """) * (C:C=""" & feeder & """) * (D:D=""" & origenAWB & """) * (E:E=""" & destinoAWB & """),0))") Next i 

对于INDEX部分,我需要得到第6 + i列的值,但是我不知道该怎么做,因为列标有字母。

我需要做的是在“表格”中find符合多个条件的值。 例如,如果我有下表:

  ABCDE 1 a1 a2 a3 a4 a5 2 b1 b2 b3 b4 b5 3 . . . 4 . . . 5 . . . . . . 

我需要得到列E中的值与列A,B,C和D中的值匹配。例如,对于值a1,a2,a3和a4,我应该得到a5。 所有这一切,使用VBA。

你不能只是让stringdynamic?

如下:
"...=INDEX(6+i,(MATCH(1,..."

新版本:
"...=INDEX(" & Col_Letter(6+i)) & ":" & Col_Letter(6+i)) & ",(MATCH(1,..."

用这个来得到这封信。 从这个SO post 函数将列号转换为字母?

 Function Col_Letter(lngCol As Long) As String Dim vArr vArr = Split(Cells(1, lngCol).Address(True, False), "$") Col_Letter = vArr(0) End Function