[问题] cells 复数回传问题

楼主: SEEKME (烤鸭)   2018-08-10 11:04:14
版本: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
感谢大大协助
作者: soyoso (我是耀宗)   2018-08-10 11:15:00
array改为range读入会是二维阵列,要ubound回传维度的最大方面,要指定2其他用到变量Out的维度写法也要调整

Links booklink

Contact Us: admin [ a t ] ucptt.com