Converting calculation expressed as text into a formula
for RowCount = 1 to 100
.Range("B" & RowCount) = Evaluate(.Range("A" & RowCount))
next RowCount
"Paul Stagg" wrote:
I would like to be able to convert a calculation expressed as text in one
column into the answer in the next column.
As a simple example, I would like to type "2 * 3" in column A and for "6" to
then appear in column B.
I will probably also need to do more complicated calculations such as "(6 +
7) * (3 + 3) as well.
I tried to create a macro to achieve this, but the problem is that it was
always specific to the row in which I was typing at the time the macro was
created.
Can anyone suggest a method?
As a bonus question, rather than the "*" I would like to be able to type "x"
in the text cell.
I managed to achieve this in a macro by copying the text to column C,
finding the "x"s and replacing them with "*"s within that and column D
(because you can't find and replace within a single cell) but then ran into
the problem above.
Thanks in advance.
|