I have some variables stored as strings in worksheets that I would like to do calculations on in VBA after I define the variables as values.
Example; In cell A1, I have... "((Pmat * 5) + (Pmdf + 150) - (Zmdf * 1.5)) / 2"
Pmat, Pmdf, and Zmdf are all variables that are assigned numbers in VBA. For instance let; Pmat = 10, Pmdf = 45, and Zmdf = 20. I would end up with 107.5 as my value.
However I can't simply do; X = Range.Value
If I pull A1 value into VBA as "Formula = Range.Value ". What should I Dim Formula as so that VBA knows part of the info in that range is variables and other parts are part of the equation?
Bookmarks