Formula in Cell with VBA

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I have the following code in my project:

For j = 1 To 8

Range("Prices").Columns(j).Select

If j < mMinRental Then
Range("Prices").Columns(j).Cells.Value = 0
ElseIf j < 8 Then Range("Prices").Columns(j).Cells.Formula = InputBox("How do we calculate " & j & " prices?", "Formulas")
End If

This is meant for the user to input the formula with which the prices for a given group of products will be calculated.

When the inputbox result is, for example, =Seven/2 (Seven being a range in the worksheet) this works marvellously, but if the input is, for example, =MROUND(Seven/2;0,1) this results in an error: "Application-defined or Object-defined error".

Can someone help me please?

Thank you,

Khlaudhya
 
Hi sebastien,

thanks for your suggestion. The FormulaLocal worked perfectly.

Regards,

Khlaudhya
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top