我用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
请excel高手帮忙指点迷津
所有跟帖:
•
str(nRow) & "-" & str(nCol)
-Largo-
♂
(0 bytes)
()
09/25/2009 postreply
06:47:33
•
谢谢,不过好像还是不行
-cloudate-
♂
(86 bytes)
()
09/28/2009 postreply
00:39:57
•
回复:请excel高手帮忙指点迷津
-jgyang169-
♂
(85 bytes)
()
10/06/2009 postreply
01:25:30