0

I already asked a question like this before, but seems that the answer given is not working in this case

this is my code:

Worksheets("Sheet").Range(myRange).formula = "=CONCATENATE(CODICI!" & stringCodiceCella & ";" & stringDesignazioneCella & ")"

Note that stringCodiceCella is a String, and stringDesignazioneCella is also a String.

Following this link A working example of formula in VBA

I can't see the error.

ChangeWorld
  • 421
  • 1
  • 6
  • 22

1 Answers1

1

You can use "," in place of ";" as suggested by @BigBen

Worksheets("Sheet").Range(myRange).Formula = "=CONCATENATE(CODICI!" & stringCodiceCella & "," & stringDesignazioneCella & ")"

Or use FormulaLocal

Worksheets("Sheet").Range(myRange).FormulaLocal = "=CONCATENATE(CODICI!" & stringCodiceCella & ";" & stringDesignazioneCella & ")"

Edit: See below code.

Worksheets("Sheet").Range(myRange).Formula = "=CONCATENATE(CODICI!" & stringCodiceCella & ",""-""," & stringDesignazioneCella & ")"

Worksheets("Sheet").Range(myRange).FormulaLocal = "=CONCATENATE(CODICI!" & stringCodiceCella & ";""-"";" & stringDesignazioneCella & ")"

shrivallabha.redij
  • 5,832
  • 1
  • 12
  • 27