3

我正在为一堆列创建列标题。我想像下面那样做它们 - 但我无法正确使用语法。任何人都可以帮忙吗?

Range("AB1:AE1").Value = ("UnitPriceUSD","TotalCostUSD","UnitPrice", "TotalCost")
4

1 回答 1

4

试试这个。

Dim arr As Variant
arr = Array("UnitPriceUSD", "TotalCostUSD", "UnitPrice", "TotalCost")

Range("AB1:AE1").Value = arr

或者更简单:

Range("AB1:AE1").Value = Array("UnitPriceUSD", "TotalCostUSD", "UnitPrice", "TotalCost")
于 2012-10-04T08:29:33.107 回答