title: excel vba runtime error 7 - out of memory
body: <p>I have two macros in a worksheet. The first one check whether certain cells are addressed and have certain values then runs another macro. The following code is used for this:</p>
  
  <pre><code>Private Sub Worksheet_Change(ByVal Target As Range)
  
  If Not Intersect(Target, Range("K10:K1000")) Is Nothing And Target.Value = "Trapezoidal       roof 0.6mm and above" Or Target.Value = "LightBox ballasted" Then
  
  Application.ScreenUpdating = False
  
  Call PPAPricePerkWp
  
  End If
  
  End Sub
  </code></pre>
  
  <p>This works fine on it's own.</p>
  
  <p>The second macro is run when a button is clicked. This macro copies and pastes cells/rows to other parts of the spreadsheet. </p>
  
  <p>When the macro is run I get the error <code>Runtime error 7 - out of memory</code> and it breaks on the above bit of code.</p>
  
  <p>Is there another way I can check whether cells in a certain column are addressed and have certain values and won't lead to the above error?</p>