title: EPM/BPC BEFORE Save Function
body: <p>I'm using a custom vba function with SAP BPC 10 (EPM 10), I'm using the BEFORE Save function to force the user to succeed in validation checks before information is saved into the database.</p>
  
  <p>The problem is I want the user to go through one set of checks if they select the EPM Save Worksheet button and a different set of checks if they select the EPM Save Workbook button (the first just for the active sheet, the second for all sheets in the workbook).</p>
  
  <p>Any ideas?</p>
  
  <p>This is the code I am using, but I need it to be more dynamic to pick up if the user is simply saving data in the worksheet or for the entire workbook.</p>
  
  <p>Let me know, thanks!</p>
  
  <pre><code>Function BEFORE_SAVE()
  
  If Range("rng_Validation") = 0 Then
  
  MsgBox "Please correct the numbers before saving", vbCritical
  
  BEFORE_SAVE = False
  
  Else
  
  BEFORE_SAVE = True
  
  End If
  
  End Function
  </code></pre>