I added a macro to a worksheet that fills in 36 cells when a user double clicks a cell. It was working fine and then suddenly it is taking nearly 10 seconds to fill in 36 cells with numbers I tried turning off EnableEvents and ScreenUpdating but still takes about 10 seconds, Very strange.
Any suggestions would be appreciated.
VBA Code:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If Intersect(Target, Range("A3:BL42")) Then
EditBudgetAccount Target.Row
End If
Cancel = True
End Sub
Sub EditBudgetAccount(Act As Integer)
Application.ScreenUpdating = False
Application.EnableEvents = False
Dim Ws As Worksheet
Set Ws = ActiveSheet
With Ws
.Cells(3, "BS") = .Cells(Act, "B")
For Mon = 1 To 12
.Cells(Mon + 4, 71) = .Cells(Act, (Mon - 1) * 5 + 5)
.Cells(Mon + 4, 72) = .Cells(Act, (Mon - 1) * 5 + 6)
.Cells(Mon + 4, 73) = .Cells(Act, (Mon - 1) * 5 + 7)
Next Mon
End With
Application.ScreenUpdating = True
Application.EnableEvents = True
End Sub
Any suggestions would be appreciated.