Pb de test année

gds35

XLDnaute Impliqué
Bjr a tous heureux de retrouver mes Amis du Forums de retour ap qq soucis de sante.
Voila j'ai un p'tit Pb je cree un prg de gestion d'une entreprise et je veux automatiser le chg d'exercice . Je saisie une anneeN puis une annéeN+1 et veux tester si N+1 est bien > a N (+1) soit si 2008 + 1 = bien 2009. N'y arrive
Je vs joins mon code. Merci de votre aide
Sub Test1()
'
' Test1 Macro
' Macro enregistrée le 26/07/2008 par Gérard DESRONDIERS
'
Const TITRE As String = "CHANGEMENT D'EXERCICE"
Const ANNEN As String = "ANNEE EN COURS ?"
Const ANNEN1 As String = "ANNEE N + 1 ?"
Dim Reponse As VbMsgBoxResult
Dim ValAN0 As Integer
Dim ValAN1 As Integer
'
saisie:
Range("A4").Select
ActiveCell = InputBox(ANNEN, TITRE, ValAN0)
Range("A3").Select
ActiveCell = InputBox(ANNEN1, TITRE, ValAN1)
'If ValAN1 <> ValAN0 + 1 Then
'Reponse = MsgBox("L'ANNEE N ou N + 1 EST ERRONEE , VERIFIEZ VOTRE SAISIE", vbYesNo, "ERREUR")
'If Reponse = vbYes Then
'GoTo saisie
'Else
'Exit Sub
'End If
'End If
 

Membres actuellement en ligne

Statistiques des forums

Discussions
312 379
Messages
2 087 762
Membres
103 661
dernier inscrit
fcleves