看板 Office 關於我們 聯絡資訊
軟體: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他們回傳的是公式 但不是數值 可以讓他只回傳計算結果嗎? -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 59.115.222.67 ※ 文章網址: https://www.ptt.cc/bbs/Office/M.1422720477.A.3E6.html
soyoso: 是否提供檔案呢? 02/01 00:15
winnina1: Into_Date_B 與 Into_Date_E 是可以正常跑出正確值 02/01 00:24
winnina1: 檔案的話要處理處理@@" 02/01 00:25
winnina1: 他其實牽扯到多個檔案的處理 .txt是其他檔案 02/01 00:26
※ 編輯: winnina1 (59.115.222.67), 02/01/2015 00:32:58 ※ 編輯: winnina1 (59.115.222.67), 02/01/2015 08:44:12
soyoso: 回傳計算結果方面可google excel vba evaluate 02/01 09:21
soyoso: 簡寫則為中括號[公式] 02/01 09:26
soyoso: 如以原文中會以字串連結變數的話,則以evaluate 02/01 09:34
winnina1: 後來直接跳過寫成數值的過程 直接用evalue帶進去即可 02/06 22:13