Copy and paste formula result as value

2019-08-08 21:36发布

问题:

I wanted to know if able to paste the result of the formula below into a value in VBA. I would like to copy the formula from my temporary workbook and paste it in another workbook.

=LEFT(C32,SEARCH("invoice",C32,1)-1)

回答1:

Yes. Here is an example

Range("A32").Formula = "=LEFT(C32,SEARCH(""invoice"",C32,1)-1)"
Range("A32").Value = Range("A32").Value '~~> This will convert the formula into value