|
▼おにこ さん:
こんなことでしょうか?
上から順にマクロを実施してください。
Sub データ分解()
Selection.TextToColumns Destination:=Range("A1"), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=False, _
Semicolon:=False, Comma:=False, Space:=False, Other:=True, OtherChar _
:="、", FieldInfo:=Array(Array(1, 1), Array(2, 1)), TrailingMinusNumbers:=True
End Sub
Sub 探す()
For n = 1 To 10
p = 0
p1 = 0
For i = 1 To 10
If Cells(n, i) <> "" Then
If Cells(n, i).Value Like "*<*" Then
Cells(n, 33 + p) = Cells(n, i)
p = p + 1
Else
Cells(n, 27 + p1) = Cells(n, i)
p1 = p1 + 1
End If
Else
Exit For
End If
Next
Next
End Sub
Sub 結合()
For n = 1 To 10
For i = 1 To 5
If Cells(n, 27 + i) <> "" Then
Cells(n, 27) = Cells(n, 27) & "、" & Cells(n, 27 + i)
Cells(n, 27 + i) = ""
End If
Next
Next
For n = 1 To 10
For i = 1 To 5
If Cells(n, 33 + i) <> "" Then
Cells(n, 33) = Cells(n, 33) & "、" & Cells(n, 33 + i)
Cells(n, 33 + i) = ""
End If
Next
Next
End Sub
|
|