on ‎2020 Jun 28 3:18 AM
Hello Experts,
Need some help on macro code. Save data with if condition.
Below is inputtemplate having negative values coming from othersheets and i need to allocate the data as below
If i click on Save macro button it should check if Total is zero then only should save else should not save the data after click on macro button. ( for all total columns H:Total /I:total,J:Total)

I tried with some code below and not sure how to apply the code if condition is true save the data?

Please advise some macro code if you have already implemented.
Thanks
Kishore V
Request clarification before answering.
Easy:
If Range("H27").Value = 0 And Range("I27").Value = 0 And Range("J27").Value = 0 Then
ref.SaveWorksheetData
Else
MsgBox "Totals not Equal to zero"
End If
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
vadim.kalinin
I have opened separate thread for above issue and example scenario given. Please help in macro code to save data from multiple sheets with if condition (if total is zero save )
Please find the thread open newly
https://answers.sap.com/questions/13131508/bpc-save-macro-for-multiple-sheets-with-if-conditi.html
Thanks
Kishore V
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
vadim.kalinin
I have 3 input forms in same sheet to allocate the different countries data
Regards
KIshore V
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
vadim.kalinin
Can you please let me know where to place GetReportsDatacountToSubmit in EPM Save macro.
Best Regards
Kishore V
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Please read my old answer:
https://answers.sap.com/questions/11614501/detect-data-to-save.html
GetReportsDataCountToSubmit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
vadim.kalinin
Below save macro code is working fine and only we dont want to see the below message after click on macro save data button. Could you please help me macro code any thing need to do modify.

Dim EPM As New FPMXLClient.EPMAddInAutomation
Sub save()
Dim ref As New EPMAddInAutomation
ref.SaveWorksheetData
If Range("H27").Value = 0 And Range("I27").Value = 0 And Range("J27").Value = 0 And Range("K27").Value = 0 And Range("L27").Value = 0 And Range("M27").Value = 0 Then
ref.SaveWorksheetData
End If
If Range("H54").Value = 0 And Range("I54").Value = 0 And Range("J54").Value = 0 And Range("K54").Value = 0 And Range("L54").Value = 0 And Range("M54").Value = 0 Then
ref.SaveWorksheetData
End If
If Range("H86").Value = 0 And Range("I86").Value = 0 And Range("J86").Value = 0 And Range("K86").Value = 0 And Range("L86").Value = 0 And Range("M86").Value = 0 Then
ref.SaveWorksheetData
End If
End Sub
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
vadim.kalinin
Thank you and it is working fine
Regards
Kishore V
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 34 | |
| 6 | |
| 4 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.