|
▼さちきょん さん:
こんばんは
こちらではWindows2000、Excel2000で動いているのですが^^;
これではどうですか?
Sub セル統合()
Dim v As Integer
Dim i As Integer
Dim strSize(0 To 7) As String
Dim strTEXT As String
Dim lngEndROW As Long
lngEndROW = Range("E65536").End(xlUp).Row
If lngEndROW < 8 Then Exit Sub
For v = 8 To lngEndROW
For i = 0 To 7
strSize(i) = IIf(Cells(v, i * 2 + 7).Value = "", "", "S/" & Cells(v, i * 2 + 7).Value & ",")
Next i
Select Case Cells(v, 5).Value
Case "A"
strTEXT = strSize(0) & strSize(1) & strSize(2) & strSize(3) & strSize(4)
Case "B"
strTEXT = strSize(1) & strSize(2) & strSize(3)
Case "C"
strTEXT = strSize(5)
Case "D"
strTEXT = strSize(6)
Case "E"
strTEXT = strSize(7)
Case "F"
strTEXT = strSize(0) & strSize(1) & strSize(2) & strSize(3)
End Select
If strTEXT <> "" Then
strTEXT = Left(strTEXT, Len(strTEXT) - 1)
Cells(v, 24).Value = strTEXT
strTEXT = ""
End If
Next v
End Sub
|
|