mdwagner2
07-06-2011, 09:42 AM
Hello all,
I'm new here, really just getting some experience with VBA with excel, although I have some experience with other similar languages I've used, I'm having a little trouble with this one.
I've searched the net and haven't been able to find quite what I'm looking for.
I am trying to build a simple function that can output the percent change and format as a percente in excel.
Function PercentChange(CurrentValue, PreviousValue)
PercentChange = ((CurrentValue - PreviousValue) / PreviousValue)
FormatPercent (PercentChange,1)
End Function
However, there is an error on the format command when I am running it, user error obviously, except I do not understand what I am doing wrong.
Sorry this is a super basic question, but I'm just getting my feet wet!
-Mark
I'm new here, really just getting some experience with VBA with excel, although I have some experience with other similar languages I've used, I'm having a little trouble with this one.
I've searched the net and haven't been able to find quite what I'm looking for.
I am trying to build a simple function that can output the percent change and format as a percente in excel.
Function PercentChange(CurrentValue, PreviousValue)
PercentChange = ((CurrentValue - PreviousValue) / PreviousValue)
FormatPercent (PercentChange,1)
End Function
However, there is an error on the format command when I am running it, user error obviously, except I do not understand what I am doing wrong.
Sorry this is a super basic question, but I'm just getting my feet wet!
-Mark