Boostez vos compétences Excel avec notre communauté !

Rejoignez Excel Downloads, le rendez-vous des passionnés où l'entraide fait la force. Apprenez, échangez, progressez – et tout ça gratuitement ! 👉 Inscrivez-vous maintenant !

Christian0258

XLDnaute Accro
Bonsoir à tout le forum,

J'ai besoin de votre aide, afin de modifier une macro (de J.BOISGONTIER)

voir fichier joint...

Merci pour votre aide si précieuse.

Bien amicalement,
Christian
 

Pièces jointes

Re : Modif sur macro ...

Bonsoir Christian0258,

Christian0258 à dit:
1) afin de définir, non pas que la Col 3, mais de la Col J à AN.

Christian0258 à dit:
2) de changer le format # ##0.00 € en format heure [h]:mm.

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
  Application.EnableEvents = False
  If [COLOR="Blue"]Target.Column > 9 And Target.Column < 41[/COLOR] And Target.Count = 1 Then [COLOR="Green"]' colonne 10 (J) à la colonne 40 (AN)[/COLOR]
    If Target.NoteText = "" Then Target.AddComment        [COLOR="Green"]' Création commentaire[/COLOR]
    Target.Comment.Text Text:=Target.Comment.Text & _
       Format(Target.Value, [COLOR="Red"][I]"[h]:mm"[/I][/COLOR]) & " Modifié par:" & Environ("UserName") & _
         " Le " & Now & vbLf
    Target.Comment.Shape.TextFrame.AutoSize = True
  End If
  Application.EnableEvents = True
End Sub

La macro ci-dessus répond à tes exigences, elle te convient?

Bonne soirée
 
Re : Modif sur macro ...

Re le forum, Excel-lent,

Je souhaiterais modifier la zone d'application de cette macro ;
de la zone J8 à AN22.

Pourriez-vous m'aider s.v.p

Merci d'avance.

Bien amicalement,
Christian
Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
If Target.Column > 9 And Target.Column < 41 And Target.Count = 1 Then ' colonne 10 (J) à la colonne 40 (AN) If Target.NoteText = "" Then Target.AddComment ' Création commentaire
Target.Comment.Text Text:=Target.Comment.Text & _
Format(Target.Value, "") & " modifié par : " & Environ("UserName") & _
" le " & Now & vbLf
Target.Comment.Shape.TextFrame.AutoSize = True
End If
Application.EnableEvents = True
End Sub
 
Dernière édition:
- Navigue sans publicité
- Accède à Cléa, notre assistante IA experte Excel... et pas que...
- Profite de fonctionnalités exclusives
Ton soutien permet à Excel Downloads de rester 100% gratuit et de continuer à rassembler les passionnés d'Excel.
Je deviens Supporter XLD

Discussions similaires

Réponses
18
Affichages
545
Réponses
2
Affichages
471
Retour