本文介绍了Vba Excel 从关闭的文件中进行 vlookup的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想从关闭文件到活动的打开文件进行 vlookup,关闭文件的路径将作为变体给出
I would like to do a vlookup from a close file to an active open file, The path of the closed file will be given as a variant
让我们说 mypath = "C:list...."
不知道是只设置路径好还是全路径好(路径+文件名)
I don't know if it is better to set the path only or the full-path (path+filename)
你能帮忙吗?
推荐答案
您将需要完整路径.
示例
Option Explicit
Public Sub Example()
Dim Path As String
Path = "C:Temp"
With ThisWorkbook.Sheets("Sheet1")
.Range("B1").Formula = "=VLOOKUP(A1,'" & Path & "[Book1.xlsx]Sheet2'!A:J,3,FALSE)"
End With
End Sub
这篇关于Vba Excel 从关闭的文件中进行 vlookup的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!