Moderator's note: I modified your title to be more specific. Normally I would just issue a warning but in this case I sympathized. --6StringJazzer
Hi all,
The original questions is to create 4 quarter sheets from the annual sales sheet, and a smart guy helped me with this code. I tried this code, and it works well, but I have a hard time of understanding some portion of this code. what is the .End(3)(1) and .End(3)(2) Refer to? Any people have any idea? thank you very much !!
Sub florayaoyao()
Dim i As Integer
For i = 1 To 4
Sheets.Add.Name = "Quarter " & i
ActiveSheet.Rows(1).Value = Sheets("Sheet1").Rows(1).Value
Next i
With Sheets("Sheet1")
For i = 2 To .Range("A" & Rows.count).End(3)(1).Row
Select Case Month(.Range("A" & i))
Case Is = 1, 2, 3
.Rows(i).Copy Sheets("Quarter 1").Range("A" & Rows.count).End(3)(2)
Case Is = 4, 5, 6
.Rows(i).Copy Sheets("Quarter 2").Range("A" & Rows.count).End(3)(2)
Case Is = 7, 8, 9
.Rows(i).Copy Sheets("Quarter 3").Range("A" & Rows.count).End(3)(2)
Case Is = 10, 11, 12
.Rows(i).Copy Sheets("Quarter 4").Range("A" & Rows.count).End(3)(2)
End Select
Next i
End With
End Sub
Any help is appreciated!!
Bookmarks