Multiplication dans macro

Fermé
Utilisateur anonyme - 4 nov. 2011 à 11:49
michel_m Messages postés 16593 Date d'inscription lundi 12 septembre 2005 Statut Contributeur Dernière intervention 23 mars 2023 - 4 nov. 2011 à 16:01
Bonjour à tous,
je voudrais savoir comment insérer une formule de calcul (B&*B2)
je joins la formule pour exemple.
Merci pour votre aide

Sub saisieNombre()

Dim prix As Integer, marge As Single, prixvente As Single
On Error Resume Next

testprix:
Range("b1").Select
ActiveCell.FormulaR1C1 = Application.InputBox("prix :", "infos", "", valdéf1, Type:=1)
On Error GoTo testprix

testmarge:
Range("b2").Select
ActiveCell.FormulaR1C1 = Application.InputBox("marge :", "infos", "", valdéf2, Type:=1)
On Error GoTo testmarge

prixvente:
Range("b3").Select
ActiveCell.Calculate = ("prix" * "marge")
End Sub


A voir également:

1 réponse

michel_m Messages postés 16593 Date d'inscription lundi 12 septembre 2005 Statut Contributeur Dernière intervention 23 mars 2023 3 292
4 nov. 2011 à 16:01
bonjour

curieux code...
en attendant

range("B3")=range("B1")*range("B2")





0