I am tiring to have a macro write a list of Formulas to cells and when I run it I get a Debug Error. What is wrong with my code?
Please Login or Register to view this content.
I am tiring to have a macro write a list of Formulas to cells and when I run it I get a Debug Error. What is wrong with my code?
Please Login or Register to view this content.
Last edited by CityMPLSEmpolyee; 06-10-2011 at 10:42 AM.
I know what's happening. I'm not sure what the fix is outside of changing your formulas. VBA is seeing your second " as the end of the formula
If you replace your "" with 0 for examplePlease Login or Register to view this content.
It works fine.Please Login or Register to view this content.
ChemistB
My 2?
substitute commas with semi-colons if your region settings requires
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)
Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble
Thanks, that works.
But why is it that we can't enter in a blank through the macro, when in the cell I can write the Formula to enter blank?
Hi,
My rule is when trying to convert an Excel formula to a VBA formula in the .Formula = line is to double every quote mark after putting a Quote at the front and end of the Excel Formula.
Example: A cell formula of:
Changed to a VBA formula looks like this:Please Login or Register to view this content.
Put quotes in front of the equal sign and at the end and double every quote in between.Please Login or Register to view this content.
I think you will see that the """" will turn into a "" after the code is run. This would be the blank you are looking for.
Hope this helps.
One test is worth a thousand opinions.
Click the * Add Reputation below to say thanks.
ChemistB
I found your post
"Inputting a formula which contains Quotes" this was the way I should have posted it
read the replay you got, and that works as will,
when I tried it I put in too many ".
your help was great, Thanks
Glad I could help (Indirectly). I reposted myself because I was definitely interested in a solution. We both learned something.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks