Msgbox ponctuel

Résolu
arthur11 -  
 arthur11 -
Bonjour,
Je souhaiterais afficher un msgbox à l'ouverture d'un fichier Excel tous les lundis et aucun autre jour.

Comment est-ce possible ?

Merci par avance =)

1 réponse

cs_Le Pivert Messages postés 8437 Statut Contributeur 729
 
Bonjour,

A mettre dans ThisWorkbook :

Option Explicit
Private Sub Workbook_Open()
Dim madate As Date
Dim jour As Integer
jour = Weekday(madate, vbMonday)
MsgBox jour
If jour = 6 Then 'a adapter le jour pour le lundi
MsgBox "Jeudi"
End If
End Sub


pour en savoir plus:

http://boisgontierjacques.free.fr/pages_site/FonctionsDates.htm


@+ Le Pivert
1
arthur11
 
merci pour l'aide,

Au final j'ai trouvé un moyen via la macro
Sub Auto_Open
et j'ai intégré ma macro dedans...
0