Probleme pour Intégrer en VBA une formule dans excel
Bonjour,
je comprends pas pourquoi le resultat :
Code:
1 2 3 4 5 6 7 8 9 10 11
| For L = Nb To 2 Step -1
'calcul
valeur = Workbooks(ref).Sheets("Jours").Range("E" & L)
datej = Workbooks(ref).Sheets("Jours").Range("D" & L)
datej2 = Workbooks(ref).Sheets("Jours").Range("D" & L - 1)
'nbre FP
total0 = "=COUNTA(" & datej & "!B4:B20)"
total1 = "=COUNTA(" & datej & "!B4:B20)+" & datej2 & "!B27"
If valeur = "NON" Then Workbooks(fic).Sheets(datej).Range("B27").Formula = total0
If valeur = "OUI" Then Workbooks(fic).Sheets(datej).Range("B27").Formula = total1
Next |
Explorateur de variable
total0 = "=COUNTA(28-12-2022!B4:B20)"
total1 = "=COUNTA(28-12-2022!B4:B20)+27-12-2022!B27"
Pourquoi je retrouve pas la bonne syntaxe
formule au niveau d'excel =NBVAL(28-12-@'2022'!B4:B20)+27-12-'2022'!B27