I'm getting Procedure too Large
error in a VBA macro using MS Excel 2016.
My code is as follows but I made a shortcut so that the idea clears up.
Sub Entry_Click()
If Sheet1.Range("M4").Value = Sheet3.Range("M17").Value Then
Application.ScreenUpdating = False
Dim iRow As Long
iRow = Sheets(2).Range("A1048576").End(xlUp).Row + 1
If iRow <> 16 Then iRow = iRow + 9
With ThisWorkbook.Sheets(2)
.Range("A" & iRow).Value = Sheet1.Range("C5").Value
.Range("B" & iRow).Value = Sheet1.Range("D5").Value
End With
Application.ScreenUpdating = True
ElseIf Sheet1.Range("M4").Value = Sheet3.Range("M19").Value Then
Application.ScreenUpdating = False
iRow = Sheets(4).Range("A1048576").End(xlUp).Row + 1
If iRow <> 16 Then iRow = iRow + 9
With ThisWorkbook.Sheets(4)
.Range("A" & iRow).Value = Sheet1.Range("C5").Value
.Range("B" & iRow).Value = Sheet1.Range("D5").Value
End With
End If
End Sub