Variable dans FormulaR1C1 VBA Excel

Bonjour,

j'ai besoin d'aide svp, j'ai un probleme sur l'insertion d'une formule en VBA. voici mon code:

a = ActiveSheet.Name
Range("A1").select
ActiveCell.Value = "Tableau achat Materiel " & a
Sheets(Sheets.Count).Range("A7").Select
ActiveCell.FormulaR1C1 = "=a!RC"

Je sais ou le probleme se situe mais je sias pas comment le contourner: le probleme est au nivo du ActiveCell.FormulaR1C1 = "=a!RC", il reconnait la variable a masi ca marche si je l'insere dans "=a!RC" .

Comment faire alors, please help.

Merci d'avance

3 réponses

  1. ActiveCell.FormulaR1C1 = "='" & a & "'!RC"
    Cordialement
    Patrice
    -1