谢谢dxy27老师的再次回复,我是想把结果直接显示到工作表中,不是在单元格显示公式: 我把你在二楼传回的代码 Sub dxy() t = Sheets(1).[a1] & ".xls" Sheets(1).[b2].FormulaR1C1 = "=VLOOKUP(RC[-1]," & "[" & t & "]" & "Sheet1!C1:C2,2,FALSE)" End Sub 想转变为 Sub dxy() t = Sheets(1).[a1] & ".xls" Sheets(1).[b2].FormulaR1C1 = Application.WorksheetFunction.VLOOKUP("RC[-1]," & "[" & t & "]" & "Sheet1!C1:C2,2,FALSE") End Sub 提示参数不可选,请指导,谢谢! 我想达到的效果象如下结果: Sub jh2() [b2].Value = Application.WorksheetFunction.VLookup(Range("a2"), Range("c1:d18"), 2, False) End Sub 只是将Range("c1:d18")改为了变动数据(A1单元格值),希望能将红色标出代码修改一下
[此贴子已经被作者于2007-6-3 22:17:16编辑过] |