[算表] VBA vlookup双重查找

楼主: winnina1 (Jtin 介)   2015-02-01 00:07:53
软件:VBA
版本:2007
Into_Date_B = "=(match(" & Into_Date & "," & (j * 100) & ".txt" &
"!$A:$A,0))"
Into_Date_E = "=(match(" & Into_Date & "," & (j * 100) & ".txt" &
"!$A:$A,1))"
If Cells(i, 18) = j * 100 Then ActiveSheet.Cells(i, 29).Value = "=vlookup("
& Into_Time & ",(INDIRECT(" & (j * 100) & ".txt" & "!$B" & Into_Date_B &
":$H" & Into_Date_E & ")),5,0)"
请问 为什么 into_date_B 和 into_date_E 改成单纯数字的时候 就能够正常
但是如上述这样写就有问题
问题在于 into_date_B 和into_date_E他们回传的是公式 但不是数值
可以让他只回传计算结果吗?
作者: soyoso (我是耀宗)   2015-02-01 00:15:00
是否提供档案呢?
楼主: winnina1 (Jtin 介)   2015-02-01 00:24:00
Into_Date_B 与 Into_Date_E 是可以正常跑出正确值档案的话要处理处理@@"他其实牵扯到多个档案的处理 .txt是其他档案
作者: soyoso (我是耀宗)   2015-02-01 09:21:00
回传计算结果方面可google excel vba evaluate简写则为中括号[公式]如以原文中会以字串连结变量的话,则以evaluate
楼主: winnina1 (Jtin 介)   2015-02-06 22:13:00
后来直接跳过写成数值的过程 直接用evalue带进去即可

Links booklink

Contact Us: admin [ a t ] ucptt.com