【发布时间】:2013-11-12 07:57:44
【问题描述】:
今晚我在使用 VBA 语法时遇到了一些困难,希望能得到您的帮助。
我有一个用户表单,它通过 RefEdit 字段接受输入,并将其存储为变量(范围)。 (这是通过
set DurationRange = range(me.refedit1.value)
这是我今晚早些时候提出的问题。
此用户表单接受此范围输入,并将范围输出到不同的工作表中以供进一步处理。我想做的基本上是再次输出变量。
我正在尝试使用此代码:
with worksheets("Data Output")
.range("a1").offset(0, counter) = "Durations" 'this line just creates a header cell
.range("a2").offset(0, counter) = DurationsRange 'this line should output the range into cell a2
End with
但是虽然这会输出字符串,但它对范围没有任何作用。输出范围的正确方法是什么?我知道我可以为每个循环做一个,但我有很多范围,这似乎非常低效。
【问题讨论】:
-
什么是
DurationRange,CraCost、DurationsRange和Durations之间的链接在哪里? -
抱歉,为了清楚起见,我们将进行编辑。