Reputation: 31
I have a formula in my VBA code in which I would like to embed a variable. I defined an integer but am unsure how to add it to my formula.
Dim Formula as Variant
Dim Stability as Integer
Stability = 0.5
Formula = Application.WorksheetFunction.AverageIfs(range("C:C"), range("C:C"), ">=10", range("C:C"), "<=15", range("F:F"), "<=Stability")
At the end of the formula I want to include my Stability variable. What is the correct syntax for doing so?
Upvotes: 1
Views: 89