Trying to solve a post here
http://www.excelforum.com/excel-gene...-to-cells.html
Seems you can't enter a formula using Range.Formula if the formula contains quotes because VBA sees that quote as the end of the formula. Is there a solution?
Thanks in advance.Range("D6").Formula = "=IF(P6=1,P6,IF(H12=O6,1,""))"
Last edited by ChemistB; 06-10-2011 at 12:20 PM.
ChemistB
My 2¢
Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)
I think you need to double-up the quotes for it to work....
Range("D6").Formula = "=IF(P6=1,P6,IF(H12=O6,1,""""))"
Microsoft MVP - Excel
Where there is a will there are many ways. Pick One!
Please read the Forum Rules
If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below
Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.
Preferred Charities: Lupus Canada and Sick Kids Foundation.
Feel Free to Donate if you want to, for the assistance you received today.
Thanks NBVC!
ChemistB
My 2¢
Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks