[VBA]Split傳回Array-Type放進Collection Object
使用For Each迴圈將Split Func.回傳的陣列傳入Collection Object
Dim tmp, x Dim buf As New Collection tmp = ListFiles(ActiveWorkbook.Path & "\config\", "*.txt") ' Split Function tmp = Split(tmp, "|") ' Assign to Collection Object For Each x In tmp buf.Add x Next x ' Print For Each x In buf Debug.Print x Next x
留言
張貼留言