Hello All,
I have 5 different words in column K (Week, Month, Quarterly, SemiAnnual and Annual.). This information is sent from the 5 separate sheets into one sheet called "All". I have the rows sorted by Week, Month, Quarterly, SemiAnnual and Annual. I would like to place a blank row in between each of the 5 words (Week, Month, Quarterly, SemiAnnual and Annual) Below is a picture of what I would like it to look like. This is just a simple example. Below is my code for the "All" Sheet. Again, i would like to skip a row at the end of each word like week or month.
I do have 2 buttons in the sheet, one named Transfer to move all the weeks, months. . . back to their appropriate sheet and a Sort button that sorts the information coming into the "All" sheet.
I have 5 different words in column K (Week, Month, Quarterly, SemiAnnual and Annual.). This information is sent from the 5 separate sheets into one sheet called "All". I have the rows sorted by Week, Month, Quarterly, SemiAnnual and Annual. I would like to place a blank row in between each of the 5 words (Week, Month, Quarterly, SemiAnnual and Annual) Below is a picture of what I would like it to look like. This is just a simple example. Below is my code for the "All" Sheet. Again, i would like to skip a row at the end of each word like week or month.
I do have 2 buttons in the sheet, one named Transfer to move all the weeks, months. . . back to their appropriate sheet and a Sort button that sorts the information coming into the "All" sheet.
VBA Code:
Private Sub CommandButton1_Click()
Application.ScreenUpdating = False
Dim i As Long
Dim Lastrow As Long
Dim Lastrowa As Long
Lastrow = Cells(Rows.Count, "A").End(xlUp).Row
For i = Lastrow To 4 Step -1
If Cells(i, 8) = "Not Due" And Cells(i, 11) = "Week" Then
Rows(i).Copy Destination:=Sheets("Weekly").Range("A1048576").End(xlUp).Offset(1, 0)
Rows(i).Delete
ElseIf Cells(i, 8) = "Not Due" And Cells(i, 11) = "Month" Then
Rows(i).Copy Destination:=Sheets("Monthly").Range("A1048576").End(xlUp).Offset(1, 0)
Rows(i).Delete
ElseIf Cells(i, 8) = "Not Due" And Cells(i, 11) = "Quart" Then
Rows(i).Copy Destination:=Sheets("Quarterly").Range("A1048576").End(xlUp).Offset(1, 0)
Rows(i).Delete
ElseIf Cells(i, 8) = "Not Due" And Cells(i, 11) = "SemiAn" Then
Rows(i).Copy Destination:=Sheets("SemiAnnual").Range("A1048576").End(xlUp).Offset(1, 0)
Rows(i).Delete
ElseIf Cells(i, 8) = "Not Due" And Cells(i, 11) = "Annual" Then
Rows(i).Copy Destination:=Sheets("Annual").Range("A1048576").End(xlUp).Offset(1, 0)
Rows(i).Delete
End If
Next i
Application.ScreenUpdating = True
End Sub
Private Sub CommandButton2_Click()
Application.ScreenUpdating = False
Dim Lastrow As Long
Lastrow = Cells(Rows.Count, "A").End(xlUp).Row
Set wsData = ThisWorkbook.Worksheets("ConMon Due")
Set rngData = wsData.Range("A3:L3" & Lastrow)
rngData.Sort key1:=Range("L4"), order1:=xlAscending, Header:=xlYes
Application.ScreenUpdating = True
End Sub
Last edited by a moderator: