作者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/m.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