# Calculating Data in a Worksheet Using VBA

I would like to calculate data in a couple cells and have the results show in a cell without the formula showing in that cell.
This is what I have but it actually enters the formula in the cell, and all I want in the cell is just the results.
Thanks,
Edwin
``````    If Not Application.Intersect(Target, Range("O5:P1010")) Is Nothing Then
Range("S5:S1010").FormulaR1C1 = "=IF(ISERROR(IF(OR(RC[-3]="""",RC[-6]="""",RC[-4]=""""),"""",R3C12-(RC[-3]))),"""",IF(OR(RC[-3]="""",RC[-6]="""",RC[-4]=""""),"""",R3C12-(RC[-3])))"
Range("R5:R1010").FormulaR1C1 = "=IF(ISERROR(IF(OR(RC[-5]="""",RC[1]=""""),"""",RC[1]-(RC[-3]))),"""",IF(OR(RC[-5]="""",RC[1]=""""),"""",RC[1]-(RC[-3])))"
End If
``````
###### Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Commented:
Hi,

pls try

``````   If Not Application.Intersect(Target, Range("O5:P1010")) Is Nothing Then
Range("S5:S1010").FormulaR1C1 = "=IF(ISERROR(IF(OR(RC[-3]="""",RC[-6]="""",RC[-4]=""""),"""",R3C12-(RC[-3]))),"""",IF(OR(RC[-3]="""",RC[-6]="""",RC[-4]=""""),"""",R3C12-(RC[-3])))"
Range("R5:R1010").FormulaR1C1 = "=IF(ISERROR(IF(OR(RC[-5]="""",RC[1]=""""),"""",RC[1]-(RC[-3]))),"""",IF(OR(RC[-5]="""",RC[1]=""""),"""",RC[1]-(RC[-3])))"
Range("R5:R1010").Value = Range("R5:R1010").Value
Range("S5:S1010").Value = Range("S5:S1010").Value
End If
``````
Regards
0

Experts Exchange Solution brought to you by

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Older than dirtCommented:
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0
###### It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.