作者SEEKME (烤鸭)
看板Office
标题[问题] cells 复数回传问题
时间Fri Aug 10 11:04:14 2018
版本:2010 excel
Sub fourFATNOcombine()
'
Dim Out As Variant
For n = 3 To 2000
If Cells(n, 2) <> "" Then
Out = Array(Cells(n, 146), Cells(n, 245))
这一段我要146吃到245可是不知道怎麽表达
ub = UBound(Out)
For i = 0 To ub
If Out(i) <> "" Then: OutAll = OutAll & "/" & Out(i)
Next
Cells(n, 9) = Mid(OutAll, 2, 999)
OutAll = ""
End If
Next
感谢大大协助
-----
Sent from JPTT on my Samsung SM-G950F.
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 49.214.65.93
※ 文章网址: https://webptt.com/cn.aspx?n=bbs/Office/M.1533870259.A.A82.html
1F:→ soyoso: array改为range 08/10 11:15
2F:→ soyoso: 读入会是二维阵列,要ubound回传维度的最大方面,要指定2 08/10 11:22
3F:→ soyoso: 其他用到变数Out的维度写法也要调整 08/10 11:24