I came pretty close to solving my problem with this answer given by "barry houdini" But I run into problems incorporating it to my needs.
=SUMPRODUCT(VALUE(0&SUBSTITUTE(A1:A8,"*","")))
Edit #3 - @Rory came with a very good answer to solving my problem. But what I hadn't thought about was if you enter a non-numerical value inside a cell, then the formula returns an error. So I would really like to tweak the following formula to ignore the letter "x", or non-numerical values (if that's easier):
-
ActiveCell.FormulaR1C1 = "=SUMPRODUCT(VALUE(0&SUBSTITUTE(INDIRECT(""R10C:R[-1]C"",FALSE),""s"","""")))"
Dim Cell As Range
For Each Cell In Range("all_cells")
Cell.Formula = Range("one_cell").Formula
Next
What I'm now trying to do, is write a VBA script to summarize a dynamic range, AND include values that have an "S" behind them BUT not fail or return an error on any other letters. Most importantly the letter "x".
After that first formula is set, I want to autofill that formula to the right ; stopping on a known column.
End edit
For the sake of history and other google searches, here's the original code I used before having the "s" and "x" problem.
ActiveCell.FormulaR1C1 = _
"=SUM(INDIRECT(ADDRESS(10,COLUMN())&"":""&ADDRESS(ROW()-1,COLUMN())))"
What this does is basically summarize from a set row (row#10) and stop the summary on the row just before the cell with this formula.
Example of what I want to achieve: "3+4S+2 + x = 9" ; instead of "= 5" or "##"