VBA Code Formulaire TVA

Bonjour,

J'aimerais créer un formulaire qui me permet de modifier le taux de TVA à partir d'un bouton de commande

Pour le Userform1 :

Private Sub UserForm_Activated ()

TextBox1.Value = sheeta ("SUJET").Cells (11, 2).Value

End Sub

Private Sub CommandButton1_Click ()

If TextBox1.Value <= 0 Or TextBox1.Value > 1 Then

MsgBox ("Votre tva n'est pas correcte")

Unload Me

Else

ThisWorkbook.Sheets ("SUJET").Cells (11, 2).Value = TextBox1.Value

Unload Me

End If

End Sub

Private Sub CommandButton2_Click ()

Unload Me

End Sub

Pour le module1 :

Sub majtva clickbutton ()

UserForm1.Show

End Sub

Private Sub UserForm_Activated () 

 TextBox1.Value = sheeta("SUJET").Cells (11, 2).Value

End Sub 

Private Sub CommandButton1_Click ()

If TextBox1.Value <= 0 Or TextBox1.Value > 1 Then

MsgBox ("Votre tva n'est pas correcte")

Unload Me

Else 

 ThisWorkbook.Sheets ("SUJET").Cells (11, 2).Value = TextBox1.Value

Unload Me End If

End Sub

Private Sub 

CommandButton2_Click ()

Unload Me End Sub

Sub majtva clickbutton ()

UserForm1.Show

End Sub

Merci beaucoup !

Salut,

Besoin d'un formulaire pour cela ?

000331

Une simple validation de donnée fait très bien le travail.

Tazz, Utilise les balises </> pour poster du code, et vérifie que tout soit OK car là il court à la cata...

UserForm_Activated() entre autre, cela n'existe pas.

Unload Me End If il manque au minimum les deux points.

Sub majtva clickbutton () Et là c'est message d'erreur assuré.

Private Sub ComboBox1_Change()

Position = ComboBox1.ListIndex

'MsgBox Position

Position = Position + 2

TextBox1.Value = Feuil1.Cells(Position, 3)

End Sub

Private Sub CommandButton1_Click()

Position = ComboBox1.ListIndex + 2

Feuil1.Cells(Position, 3).Value = TextBox1.Value

End Sub

Private Sub CommandButton2_Click()

Unload Me

End Sub

Private Sub UserForm_Activate()

i = 2

Do While Feuil1.Cells(i, 2) <> ""

ComboBox1.AddItem (Feuil1.Cells(i, 2))

i = i + 1

Loop

End Sub

Private Sub UserForm_Click()

MsgBox "Concentrez vous sur votre travail !!!!! ", vbOKOnly + vbInformation, "RAPPEL A L'ORDRE"

End Sub

Salut,

C'est si compliqué d'utiliser les balises </> ?

C'est quoi ça ? Tu nous prend pour des devins ?

Rechercher des sujets similaires à "vba code formulaire tva"