cloudate2009-09-25 14:28:03
我用marcos定义一个cell的值=为vloopup这个cell的横坐标种坐标在一列数据中的值。但是macros里面,

数据:
1-1 05
2-5 02
3-5 02
2-3 05

______________________________________________________
Dim nRow As Integer
Dim nCol As Integer

nRow = 1 '横坐标
nCol = -1 '纵坐标

Range("G3").Select
ActiveCell.FormulaR1C1 = _
"=VLOOKUP(nRow & nCol,'sheet1'!R21C38:R5000C39,2,FALSE)"
______________________________________________________


反映出来的值是#NAME? 等于 VLOOKUP(nRow & nCol,'TRS31 1007'!$AL$21:$AM$5000,2,FALSE)

而不是我需要的 05 等于 VLOOKUP("1-1",'TRS31 1007'!$AL$21:$AM$5000,2,FALSE)


请问如何改正marcos,让里面的nRow & nCol become 1-1

xiexie thanks a lot
Largo2009-09-25 14:47:33
str(nRow) & "-" & str(nCol)
cloudate2009-09-28 08:39:57
谢谢,不过好像还是不行
jgyang1692009-10-06 09:25:30
回复:请excel高手帮忙指点迷津