Hi, I am busy with a custom calendar. I need to add code to this code so that it skips the hidden rows after filtering.
Sub Months()
'
' Months Macro
'
'
Dim I As Long, j As Long, x As Long, lr As Long
Dim sh1 As Worksheet, sh2 As Worksheet
Set sh1 = Worksheets("Calendar")
Set sh2 = Worksheets("Data")
lr = sh2.Cells(Rows.Count, "U").End(xlUp).Row
I = 14
j = 4
sh1.Cells(Rows.Count, 4).End(xlUp).EntireRow.Delete
Application.ScreenUpdating = False
Do While I < lr + 1
For x = 2 To 8
sh1.Cells(j, x).Value = sh2.Cells(I, 21).Value
sh1.Cells(j + 1, x).Value = sh2.Cells(I, 10).Value
sh1.Cells(j + 2, x).Value = sh2.Cells(I, 22).Value
sh1.Cells(j + 3, x).Value = sh2.Cells(I, 5).Value
I = I + 1
Next x
j = j + 4
Loop
'Application.ScreenUpdating = True
End Sub
Bookmarks