writting formula on cell gives me a compile error: sintax error

excells

New Member
Joined
Feb 6, 2014
Messages
29
Hi,
I hope all is well.

Im doing my head in with the following expression:

Code:
Range("i" & varRowForBudgets).Formula = "=g "& varRowForBudgets&"/ g "& varRowForBudgets+10&""
Range("i" & varRowForBudgets).NumberFormat = "0.00%"


varRowForBudgets is currently 2000, replacing on the above:
I want VBA to write a formula in i2000
the formula i need written on cell i2000 is meant to be: =g2000/g2010
Im getting a compile error targeting "/" on the above expression.

Could anyone shed some light on this issue?

Regards,
Juan Arango
 
Last edited:

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
maybe,

Range("i" & varRowForBudgets).Formula = "=g " & varRowForBudgets & "/g " & varRowForBudgets + 10
 
Upvote 0
Hi Fazza,
I got it to work based on your suggestion.
in the end I used:

Range("i" & varRowForBudgets).Formula = "=g" & varRowForBudgets & "/g" & varRowForBudgets + 10 & " "

thanks a lot.

regards,
Juan
 
Upvote 0

Forum statistics

Threads
1,223,909
Messages
6,175,313
Members
452,634
Latest member
cpostell

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