我想在單元格範圍內運行排名公式。我在撓撓我的頭,爲什麼它不工作。拉斯特羅只是計算行數的公式。在VBA中將公式作爲語法寫入
Range("B1:B" & Lastrow).Formula = "=RANK(A1,Offset(" & Chr$(36) & "A1" & Chr$(36) & "," & Lastrow & ",0))"
我覺得這是與CHR $(36)做錯事,但是當我嘗試CHR(36),它也不起作用。 (刪除這些chr(36)的和只有偏移量(A1 ...等)工作正常)。
在此先感謝!
被愚蠢!'Range(「B1:B」&Lastrow).Formula =「 = RANK(A1,A1:偏移量(「&Chr(36)&」A「&Chr(36)&」1「)&Lastrow &「,0))」' – mrhappysmile
所以你得到它的工作? – ashleedawg
爲什麼你使用Chr(36)而不是隻給$加入字符串? – ashleedawg