看板 Office 關於我們 聯絡資訊
版本: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://www.ptt.cc/bbs/Office/M.1533870259.A.A82.html
soyoso: array改為range 08/10 11:15
soyoso: 讀入會是二維陣列,要ubound回傳維度的最大方面,要指定2 08/10 11:22
soyoso: 其他用到變數Out的維度寫法也要調整 08/10 11:24