title: Excel 'procedure is too large' ,how to make code smaller
body: <p>Tried all sort of things, just wont work, need the code to be smaller so i can expand macro.
  Thanx</p>
  
  <pre><code>Dim m2 As Variant
  Dim n2 As Variant
  Dim m3 As Variant
  Dim n3 As Variant
  Dim m4 As Variant
  Dim n4 As Variant
  ' and so on ...
  Private Sub Worksheet_Change(ByVal Target As Range)
  On Error GoTo Badentry
  If Range("m2").Value = 1 And m2 &lt;&gt; 1 Then
  ActiveSheet.Range("A2:l2").Select
  ActiveWorkbook.EnvelopeVisible = True
  With ActiveSheet.MailEnvelope
    .Introduction = " send thru macro "
    .Item.To = "d@gmail.com"
    .Item.Subject = "ALERT"
    .Item.Send
   End With
  
  End If
  m2 = Range("m2").Value
  
  If Range("n2").Value = 1 And n2 &lt;&gt; 1 Then
  ActiveSheet.Range("A2:l2").Select
  ActiveWorkbook.EnvelopeVisible = True
  With ActiveSheet.MailEnvelope
    .Introduction = " send thru macro "
    .Item.To = "@gmail.com"
    .Item.Subject = "ALERT"
    .Item.Send
  End With
  End If
  n2 = Range("n2").Value
  Badentry:
  ' and so on...
  End sub    
  </code></pre>