convert string to a formula

doug firr

Board Regular
Joined
Mar 28, 2011
Messages
140
I have a column, actually of screen resolutions with thousands of rows that look something like this:

943*530
953*572
969*768
986*1236
999*599

<colgroup><col width="64" style="width:48pt"> </colgroup><tbody>
</tbody>

I would like to know the screen area hence add "=" in front of each value.

I did this using concatenate but it just displays the forumla (e.g. "=943*530) and does not in fact do any calculation.

How do I get around this to show the calculated values?
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
Hi,

Assuming your data is in column A, the following macro will do as you require

Code:
Sub a()
Dim rCell As Range

For Each rCell In Range(Range("A1"), Range("A" & Rows.Count).End(xlUp))
rCell.Offset(0, 1).Formula = "=" & rCell.Value
Next

End Sub
 
Upvote 0
Thanks VoG. That works but I was hoping for a means of just converting the string to the formula, something like "=toformula". I encounter this frequently and wondered if anyone knew of anything along those lines
 
Upvote 0
Thanks VoG. That works but I was hoping for a means of just converting the string to the formula, something like "=toformula". I encounter this frequently and wondered if anyone knew of anything along those lines

You can do this in 2 steps

Assuming data starts in A1

1) In the adjacent cell put ="^"&A1, drag down to end of data range.

2) Highlight the entire column then type Ctrl+F (Find & Replace window): >Find what: ^ >Replace with: = >Replace All.

Hope this helps!
 
Upvote 0

Forum statistics

Threads
1,216,075
Messages
6,128,665
Members
449,462
Latest member
Chislobog

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top