[問題] 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