jackyysteez
New Member
- Joined
- Jul 17, 2018
- Messages
- 8
Hello, I'm fairly new to VBA and was given the task to disable the save function in EPM in accordance with when the Range C27's member property does not equal LOB_400
I have two codes...
This code completely works for my task, however, I had to corrupt cell A14 by putting the EPM Member Property formula into it... In efforts to rid my report of my tampering with cell A14... My second set of code is...
Any idea on why when I try to run this code I am not getting the same results as I would for the first set of code??
I have two codes...
Code:
Function BEFORE_SAVE()
If Range("A14").Value <> "LOB_400" Then
BEFORE_SAVE = False
MsgBox "Incorrect Cost Center. No Data was saved. Please select a cost center in LOB_400", vbAbortRetryIgnore
Else
MsgBox "Are you sure you want to Save this data?", vbOKCancel
BEFORE_SAVE = True
End If
End Function
This code completely works for my task, however, I had to corrupt cell A14 by putting the EPM Member Property formula into it... In efforts to rid my report of my tampering with cell A14... My second set of code is...
Code:
Function BEFORE_SAVE()
If WorksheetFunction.Proper(Range("C27")) <> "LOB_400" Then
BEFORE_SAVE = False
MsgBox "Incorrect Cost Center. No Data was saved. Please select a cost center in LOB_400", vbAbortRetryIgnore
Else
MsgBox "Are you sure you want to Save this data?", vbOKCancel
BEFORE_SAVE = True
End If
End Function