Dim t As Table = Tables("A")
For k As Integer = 0 To t.rows.count - 1
Dim lst As new List(of Date)
For Each s As String In t.rows(k)("日期").split(",")
lst.add(cdate(s.trim))
Next
lst.sort()
Dim ym As String = format(lst(0),"yyyy-MM")
Dim str As String = ym & "(" & lst(0).day & ","
For i As Integer = 1 To lst.count - 1
If ym = format(lst(i),"yyyy-MM") Then
str = str & lst(i).day & ","
Else
ym = format(lst(i),"yyyy-MM")
str = str.trim(",") & ")," & ym & "(" & lst(i).day & ","
End If
Next
str = str.Trim(",") & ")"
msgbox(str)
Next