Hello,
Yes is quite big. I tried to delete some things but its still maybo too heavy.
I herewith attach the the code which makes run slow the macro just in case someone can detect something that makes it run slowly.
Private Sub WorkSheet_SelectionChange(ByVal Target As Range)
'THIS CODE HIDE ROWS WHEN SELECTING DAY FROM CALENDAR
If Target.Count > 1 Then Exit Sub
If Intersect(Target, Range("$D$5:$K$10")) Is Nothing Then
Else
Application.ScreenUpdating = False
Sheet1.Rows("17:50000").EntireRow.Hidden = True
If ActiveCell = 41365 Then
Sheet1.Rows("17:66").EntireRow.Hidden = False
Else
x = ActiveCell.Value + (ActiveCell - 41365) * 49 - 41348 'Report starts in row 17. This row corresponds to the 1st of April 2013 (the format number of that date is 41365)
y = x + 49
For i = x To y
Sheet1.Rows(i).EntireRow.Hidden = False
Next i
End If
End If
End Sub
Im sure that what is giving the problem here is that my range goes up to row 50.000 !!
But the reason why Im selecting so huge range is because there is a lot of data that I will be introducing and would like to have a big range to work with. Maybe someone knows how to optimize better this code.
Thank you very much.
Regards
Bookmarks