Z
zertion
Guest
Salut!
voilà je vous explique,
je souhaite afficher dans n cellules, la formule suivante: (ex pour cellule 6)
=IF(BM6="";""; (IF(BM6="EUR";"1";VLOOKUP(BM6;Currencies!A:C;3;FALSE))))
voilà le code que j'ai fais:
Sub test()
Dim Cel As Range
With ActiveSheet
For Each Cel In .Range("BN1:BN" & n) 'n est le nombre de ligne
If (Cel.FormulaR1C1 = "") Then
Cel.FormulaR1C1 = "=IF(RC[-1]=" & Chr(34) & Chr(34) & "," & Chr(34) & Chr(34) & ",IF(RC[-1]=EUR,1,VLOOKUP(RC[-1],Currencies!A:C,3,FALSE)))"
End If
Next Cel
End With
End Sub
mais j'obtient cette formule dans ma feuille excel:
=IF(BM7="";"";IF(BM7=EUR;1;VLOOKUP(BM7;Currencies!A:BN:BN;FALSE)))
alors voilà, je comprends pas pourquoi j'ai:
..."Curencies!A:BN:BN"... au lieu de ..."Curencies!A:C"
Si quelqu'un peut aider un novice ce serait cool!
merci d'avance....
voilà je vous explique,
je souhaite afficher dans n cellules, la formule suivante: (ex pour cellule 6)
=IF(BM6="";""; (IF(BM6="EUR";"1";VLOOKUP(BM6;Currencies!A:C;3;FALSE))))
voilà le code que j'ai fais:
Sub test()
Dim Cel As Range
With ActiveSheet
For Each Cel In .Range("BN1:BN" & n) 'n est le nombre de ligne
If (Cel.FormulaR1C1 = "") Then
Cel.FormulaR1C1 = "=IF(RC[-1]=" & Chr(34) & Chr(34) & "," & Chr(34) & Chr(34) & ",IF(RC[-1]=EUR,1,VLOOKUP(RC[-1],Currencies!A:C,3,FALSE)))"
End If
Next Cel
End With
End Sub
mais j'obtient cette formule dans ma feuille excel:
=IF(BM7="";"";IF(BM7=EUR;1;VLOOKUP(BM7;Currencies!A:BN:BN;FALSE)))
alors voilà, je comprends pas pourquoi j'ai:
..."Curencies!A:BN:BN"... au lieu de ..."Curencies!A:C"
Si quelqu'un peut aider un novice ce serait cool!
merci d'avance....