|
▼さちきょん さん:
みなさんこんばんは
わたしもひとつ・・・こんなものをつくてみました。
良ければお試しを
Sub セル統合()
Dim v As Integer
Dim Size_S As String
Dim Size_M As String
Dim Size_L As String
Dim Size_O As String
Dim Size_XO As String
Dim Size_FREE As String
Dim Size_25_27 As String
Dim Size_Nothing 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
Size_S = IIf(Range("G" & v).Value = "", "", "S/" & Range("G" & v).Value & ",")
Size_M = IIf(Range("I" & v).Value = "", "", "M/" & Range("I" & v).Value & ",")
Size_L = IIf(Range("K" & v).Value = "", "", "L/" & Range("K" & v).Value & ",")
Size_O = IIf(Range("M" & v).Value = "", "", "O/" & Range("M" & v).Value & ",")
Size_XO = IIf(Range("O" & v).Value = "", "", "XO/" & Range("O" & v).Value & ",")
Size_FREE = IIf(Range("Q" & v).Value = "", "", "フリー/" & Range("Q" & v).Value & ",")
Size_25_27 = IIf(Range("S" & v).Value = "", "", "25-27cm/" & Range("S" & v).Value & ",")
Size_Nothing = IIf(Range("U" & v).Value = "", "", "サイズなし/" & Range("U" & v).Value & ",")
Select Case Cells(v, 5).Value
Case "A"
strTEXT = Size_S & Size_M & Size_L & Size_O & Size_XO
Case "B"
strTEXT = Size_M & Size_L & Size_O
Case "C"
strTEXT = Size_FREE
Case "D"
strTEXT = Size_25_27
Case "E"
strTEXT = Size_Nothing
Case "F"
strTEXT = Size_S & Size_M & Size_L & Size_O
End Select
If strTEXT <> "" Then
strTEXT = Left(strTEXT, Len(strTEXT) - 1)
Cells(v, 24).Value = strTEXT
strTEXT = ""
End If
Next v
End Sub
|
|