【发布时间】:2014-09-07 10:35:56
【问题描述】:
所以我的 excel 文档中有一些单元格的索引。我现在正在尝试使用 VBA 在两个不同的范围之间建立联合。
到目前为止我...
Function FiveYTwoY()
Worksheets("India Data").Activate
index5_90 = Cells(10, "B").Value '5Y 90 day index
index5_yes = Cells(9, "B").Value '5Y yesterday index
index2_90 = Cells(7, "B").Value '2Y 90 day index
index2_yes = Cells(6, "B").Value '2Y yesterday index
range5_90 = "Q" & index5_90
range5_yes = "Q" & index_yes
range2_90 = "S" & index2_90
range2_yes = "S" & index2_yes
fullRange5 = Range(range5_90, range5_yes)
fullRange2 = Range(range2_90, range2_yes)
FiveYTwoY = Union(fullRange2, fullRange5)
但是这不起作用并且在调试之后......这是因为我的范围设置不正确。我该如何解决?我不断获得#value。我想打印连接的范围感谢您的帮助!
【问题讨论】:
-
如果您从工作表中调用它,它是won't work。
-
我正在从工作表中调用单元格值。你是说我需要一个潜艇?我想基本上将两个不同的范围粘贴到一列中