Private Sub CommandButton2_Click()
Dim lr As Long, lr2 As Long, lr3 As Long, lr4 As Long, lr5 As Long, lr6 As Long, lr7 As Long, lr8 As Long, lr9 As Long, lr10 As Long, lr11 As Long, lr12 As Long, lr13 As Long, lr14 As Long, lr15 As Long, lr16 As Long, lr17 As Long, lr18 As Long, lr19 As Long, lr20 As Long, lr21 As Long, lr22 As Long, lr23 As Long, lr24 As Long, lr25 As Long, r As Long
lr = Sheets("Product.sheet").Cells(Rows.Count, "A").End(xlUp).Row
lr2 = Sheets("SheetA").Cells(Rows.Count, "A").End(xlUp).Row
lr3 = Sheets("SheetB").Cells(Rows.Count, "A").End(xlUp).Row
lr4 = Sheets("SheetD").Cells(Rows.Count, "A").End(xlUp).Row
lr5 = Sheets("SheetE").Cells(Rows.Count, "A").End(xlUp).Row
lr6 = Sheets("SheetF").Cells(Rows.Count, "A").End(xlUp).Row
lr7 = Sheets("SheetG").Cells(Rows.Count, "A").End(xlUp).Row
lr8 = Sheets("SheetH").Cells(Rows.Count, "A").End(xlUp).Row
lr9 = Sheets("SheetI").Cells(Rows.Count, "A").End(xlUp).Row
lr10 = Sheets("SheetJ").Cells(Rows.Count, "A").End(xlUp).Row
lr11 = Sheets("SheetK").Cells(Rows.Count, "A").End(xlUp).Row
lr12 = Sheets("SheetL").Cells(Rows.Count, "A").End(xlUp).Row
lr13 = Sheets("SheetM").Cells(Rows.Count, "A").End(xlUp).Row
lr14 = Sheets("SheetN").Cells(Rows.Count, "A").End(xlUp).Row
lr15 = Sheets("SheetO").Cells(Rows.Count, "A").End(xlUp).Row
lr16 = Sheets("SheetP").Cells(Rows.Count, "A").End(xlUp).Row
lr17 = Sheets("SheetQ").Cells(Rows.Count, "A").End(xlUp).Row
lr18 = Sheets("SheetS").Cells(Rows.Count, "A").End(xlUp).Row
lr19 = Sheets("SheetT").Cells(Rows.Count, "A").End(xlUp).Row
lr20 = Sheets("SheetU").Cells(Rows.Count, "A").End(xlUp).Row
lr21 = Sheets("SheetV").Cells(Rows.Count, "A").End(xlUp).Row
lr22 = Sheets("SheetW").Cells(Rows.Count, "A").End(xlUp).Row
lr23 = Sheets("SheetX").Cells(Rows.Count, "A").End(xlUp).Row
lr24 = Sheets("SheetY").Cells(Rows.Count, "A").End(xlUp).Row
lr25 = Sheets("SheetZ").Cells(Rows.Count, "A").End(xlUp).Row
For r = lr To 2 Step -1
Select Case Range("D" & r).Value
Case Is = "A"
Rows(r).Copy Destination:=Sheets("SheetA").Range("A" & lr2 + 1)
lr2 = Sheets("SheetA").Cells(Rows.Count, "A").End(xlUp).Row
Case Is = "B"
Rows(r).Copy Destination:=Sheets("SheetB").Range("A" & lr3 + 1)
lr3 = Sheets("SheetB").Cells(Rows.Count, "A").End(xlUp).Row
Case Is = "D"
Rows(r).Copy Destination:=Sheets("SheetD").Range("A" & lr4 + 1)
lr4 = Sheets("SheetD").Cells(Rows.Count, "A").End(xlUp).Row
Case Is = "A"
Rows(r).Copy Destination:=Sheets("SheetE").Range("A" & lr5 + 1)
lr5 = Sheets("SheetE").Cells(Rows.Count, "A").End(xlUp).Row
Case Is = "B"
Rows(r).Copy Destination:=Sheets("SheetF").Range("A" & lr6 + 1)
lr6 = Sheets("SheetF").Cells(Rows.Count, "A").End(xlUp).Row
Case Is = "D"
Rows(r).Copy Destination:=Sheets("SheetG").Range("A" & lr7 + 1)
lr7 = Sheets("SheetG").Cells(Rows.Count, "A").End(xlUp).Row
Case Is = "A"
Rows(r).Copy Destination:=Sheets("SheetH").Range("A" & lr8 + 1)
lr8 = Sheets("SheetH").Cells(Rows.Count, "A").End(xlUp).Row
Case Is = "B"
Rows(r).Copy Destination:=Sheets("SheetI").Range("A" & lr9 + 1)
lr9 = Sheets("SheetI").Cells(Rows.Count, "A").End(xlUp).Row
Case Is = "D"
Rows(r).Copy Destination:=Sheets("SheetJ").Range("A" & lr10 + 1)
lr10 = Sheets("SheetJ").Cells(Rows.Count, "A").End(xlUp).Row
Case Is = "A"
Rows(r).Copy Destination:=Sheets("SheetK").Range("A" & lr11 + 1)
lr11 = Sheets("SheetK").Cells(Rows.Count, "A").End(xlUp).Row
Case Is = "B"
Rows(r).Copy Destination:=Sheets("SheetL").Range("A" & lr12 + 1)
lr12 = Sheets("SheetL").Cells(Rows.Count, "A").End(xlUp).Row
Case Is = "D"
Rows(r).Copy Destination:=Sheets("SheetM").Range("A" & lr13 + 1)
lr13 = Sheets("SheetM").Cells(Rows.Count, "A").End(xlUp).Row
Case Is = "A"
Rows(r).Copy Destination:=Sheets("SheetN").Range("A" & lr14 + 1)
lr14 = Sheets("SheetN").Cells(Rows.Count, "A").End(xlUp).Row
Case Is = "B"
Rows(r).Copy Destination:=Sheets("SheetO").Range("A" & lr15 + 1)
lr15 = Sheets("SheetO").Cells(Rows.Count, "A").End(xlUp).Row
Case Is = "D"
Rows(r).Copy Destination:=Sheets("SheetP").Range("A" & lr16 + 1)
lr16 = Sheets("SheetP").Cells(Rows.Count, "A").End(xlUp).Row
Case Is = "A"
Rows(r).Copy Destination:=Sheets("SheetQ").Range("A" & lr17 + 1)
lr17 = Sheets("SheetQ").Cells(Rows.Count, "A").End(xlUp).Row
Case Is = "B"
Rows(r).Copy Destination:=Sheets("SheetS").Range("A" & lr18 + 1)
lr18 = Sheets("SheetS").Cells(Rows.Count, "A").End(xlUp).Row
Case Is = "D"
Rows(r).Copy Destination:=Sheets("SheetT").Range("A" & lr19 + 1)
lr19 = Sheets("SheetT").Cells(Rows.Count, "A").End(xlUp).Row
Case Is = "A"
Rows(r).Copy Destination:=Sheets("SheetU").Range("A" & lr20 + 1)
lr20 = Sheets("SheetU").Cells(Rows.Count, "A").End(xlUp).Row
Case Is = "B"
Rows(r).Copy Destination:=Sheets("SheetV").Range("A" & lr21 + 1)
lr21 = Sheets("SheetV").Cells(Rows.Count, "A").End(xlUp).Row
Case Is = "D"
Rows(r).Copy Destination:=Sheets("SheetW").Range("A" & lr22 + 1)
lr22 = Sheets("SheetW").Cells(Rows.Count, "A").End(xlUp).Row
Case Is = "A"
Rows(r).Copy Destination:=Sheets("SheetX").Range("A" & lr23 + 1)
lr23 = Sheets("SheetX").Cells(Rows.Count, "A").End(xlUp).Row
Case Is = "B"
Rows(r).Copy Destination:=Sheets("SheetY").Range("A" & lr24 + 1)
lr24 = Sheets("SheetY").Cells(Rows.Count, "A").End(xlUp).Row
Case Is = "D"
Rows(r).Copy Destination:=Sheets("SheetZ").Range("A" & lr25 + 1)
lr25 = Sheets("SheetZ").Cells(Rows.Count, "A").End(xlUp).Row
End Select
Next r
End Sub