OVH Cloud OVH Cloud

commentaire évolutif

14 réponses
Avatar
bonjour, je cherche =E0 faire apparaitre l'interpr=E9tation=20
du r=E9sultat d'une cellule sur son commentaire.
par exemple :
sur la cellule a1 montant du budget total fixe
sur a2 montant budget janvier =E9volutif
sur a3 montant budget fevrier =E9volutif
.. etc
je veux voir en s=E9lectionnant les cellules a2 puis=20
a3, ..etc l'=E9volution du pourcentage du budget du mois=20
s=E9lectionn=E9 par rapport au budget total.
est-ce possible?

10 réponses

1 2
Avatar
garnote
Salut,

Une suggestion :

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Column = 1 And Target.Row <> 1 Then Call Commentaires
End Sub

Sub Commentaires()
On Error Resume Next
Range("A:A").ClearComments
Set ici = ActiveCell
If ici = "" Then Exit Sub
t = Format(ici.Value / [a1], "percent")
With ici
.ClearComments
.AddComment
.Comment.Text Text:="Évolution" & Chr(10) & t
.Comment.Visible = True
End With
End Sub

Serge

a écrit dans le message de news:
14c1f01c3fa01$0e0d74a0$
bonjour, je cherche à faire apparaitre l'interprétation
du résultat d'une cellule sur son commentaire.
par exemple :
sur la cellule a1 montant du budget total fixe
sur a2 montant budget janvier évolutif
sur a3 montant budget fevrier évolutif
.. etc
je veux voir en sélectionnant les cellules a2 puis
a3, ..etc l'évolution du pourcentage du budget du mois
sélectionné par rapport au budget total.
est-ce possible?
Avatar
michdenis
Bonjour,

Dans le module feuille de ton classeur, copie ce qui suit :

Dans la procédure : Ces plages sont adaptées au besoin
En A1 = montant global
En A2:A12 Montant partiel

'------------------------------------
Private Sub Worksheet_Change(ByVal Target As Range)

Dim Rg As Range
Set Rg = Range("A2:A12")

If Target.Address = Range("A1").Address Then
If IsNumeric(Range("a1")) Then
If Range("A1") <> 0 Then
LesCommentaires Rg
End If
End If
End If

Set Rg = Intersect(Target, Range("A2:A12"))
If Not Rg Is Nothing Then
LesCommentaires Rg
End If
Set Rg = Nothing
End Sub
'------------------------------------
Private Sub Worksheet_SelectionChange(ByVal Target As Range)

If Not Intersect(Target, Range("A2:A12")) Is Nothing Then
If Target.Cells.Count > 1 Then Exit Sub
Target.ClearComments
If IsNumeric(Range("A1")) And IsNumeric(Target) Then
If Range("A1") <> 0 And Target.Value <> 0 Then
Text = "Pourcentage : " & Format(Target.Value / Range("A1"), "percent")
Target.AddComment Text
End If
End If
End If

End Sub

'------------------------------------
Sub LesCommentaires(Rg As Range)
For Each c In Rg
c.ClearComments
If IsNumeric(c) Then
If c <> 0 Then
Text = "Pourcentage : " _
& Format(c.Value / Range("A1"), "percent")
c.AddComment Text
End If
End If
Next
End Sub
'------------------------------------






a écrit dans le message de news:14c1f01c3fa01$0e0d74a0$
bonjour, je cherche à faire apparaitre l'interprétation
du résultat d'une cellule sur son commentaire.
par exemple :
sur la cellule a1 montant du budget total fixe
sur a2 montant budget janvier évolutif
sur a3 montant budget fevrier évolutif
.. etc
je veux voir en sélectionnant les cellules a2 puis
a3, ..etc l'évolution du pourcentage du budget du mois
sélectionné par rapport au budget total.
est-ce possible?
Avatar
garnote
Salut Denis,

J'ai un peu changé de fil !
Tes «publications» m'ont permis de «fioriturer» ma patente :

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Column <> 1 Then
Range("A:A").ClearComments
Else
If Target.Column = 1 And Target.Row <> 1 Then Commentaires_Évolutifs
End If
End Sub


Sub Commentaires_Évolutifs()
On Error Resume Next
Range("A:A").ClearComments
Set ici = ActiveCell
If ici = "" Or Not IsNumeric(ici) Then Exit Sub
t = Format(ici.Value / [a1], "percent")
With ici
.ClearComments
.AddComment
.Comment.Text Text:="Évolution: " & t
.Comment.Visible = True
.Comment.Shape.OLEFormat.Object.AutoSize = True
End With
End Sub

Serge


























"michdenis" a écrit dans le message de news:
uf2r1Hh#
Bonjour,

Dans le module feuille de ton classeur, copie ce qui suit :

Dans la procédure : Ces plages sont adaptées au besoin
En A1 = montant global
En A2:A12 Montant partiel

'------------------------------------
Private Sub Worksheet_Change(ByVal Target As Range)

Dim Rg As Range
Set Rg = Range("A2:A12")

If Target.Address = Range("A1").Address Then
If IsNumeric(Range("a1")) Then
If Range("A1") <> 0 Then
LesCommentaires Rg
End If
End If
End If

Set Rg = Intersect(Target, Range("A2:A12"))
If Not Rg Is Nothing Then
LesCommentaires Rg
End If
Set Rg = Nothing
End Sub
'------------------------------------
Private Sub Worksheet_SelectionChange(ByVal Target As Range)

If Not Intersect(Target, Range("A2:A12")) Is Nothing Then
If Target.Cells.Count > 1 Then Exit Sub
Target.ClearComments
If IsNumeric(Range("A1")) And IsNumeric(Target) Then
If Range("A1") <> 0 And Target.Value <> 0 Then
Text = "Pourcentage : " & Format(Target.Value / Range("A1"),
"percent")

Target.AddComment Text
End If
End If
End If

End Sub

'------------------------------------
Sub LesCommentaires(Rg As Range)
For Each c In Rg
c.ClearComments
If IsNumeric(c) Then
If c <> 0 Then
Text = "Pourcentage : " _
& Format(c.Value / Range("A1"), "percent")
c.AddComment Text
End If
End If
Next
End Sub
'------------------------------------






a écrit dans le message de
news:14c1f01c3fa01$0e0d74a0$

bonjour, je cherche à faire apparaitre l'interprétation
du résultat d'une cellule sur son commentaire.
par exemple :
sur la cellule a1 montant du budget total fixe
sur a2 montant budget janvier évolutif
sur a3 montant budget fevrier évolutif
.. etc
je veux voir en sélectionnant les cellules a2 puis
a3, ..etc l'évolution du pourcentage du budget du mois
sélectionné par rapport au budget total.
est-ce possible?




Avatar
michdenis
Bonjour Garnote,

Le seul "hic" c'est que l'on doive réellement sélectionner la cellule pour visualiser le commentaire ! M'enfin !!!


Salutations!


"garnote" a écrit dans le message de news:jIn_b.74450$
Salut Denis,

J'ai un peu changé de fil !
Tes «publications» m'ont permis de «fioriturer» ma patente :

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Column <> 1 Then
Range("A:A").ClearComments
Else
If Target.Column = 1 And Target.Row <> 1 Then Commentaires_Évolutifs
End If
End Sub


Sub Commentaires_Évolutifs()
On Error Resume Next
Range("A:A").ClearComments
Set ici = ActiveCell
If ici = "" Or Not IsNumeric(ici) Then Exit Sub
t = Format(ici.Value / [a1], "percent")
With ici
.ClearComments
.AddComment
.Comment.Text Text:="Évolution: " & t
.Comment.Visible = True
.Comment.Shape.OLEFormat.Object.AutoSize = True
End With
End Sub

Serge


























"michdenis" a écrit dans le message de news:
uf2r1Hh#
Bonjour,

Dans le module feuille de ton classeur, copie ce qui suit :

Dans la procédure : Ces plages sont adaptées au besoin
En A1 = montant global
En A2:A12 Montant partiel

'------------------------------------
Private Sub Worksheet_Change(ByVal Target As Range)

Dim Rg As Range
Set Rg = Range("A2:A12")

If Target.Address = Range("A1").Address Then
If IsNumeric(Range("a1")) Then
If Range("A1") <> 0 Then
LesCommentaires Rg
End If
End If
End If

Set Rg = Intersect(Target, Range("A2:A12"))
If Not Rg Is Nothing Then
LesCommentaires Rg
End If
Set Rg = Nothing
End Sub
'------------------------------------
Private Sub Worksheet_SelectionChange(ByVal Target As Range)

If Not Intersect(Target, Range("A2:A12")) Is Nothing Then
If Target.Cells.Count > 1 Then Exit Sub
Target.ClearComments
If IsNumeric(Range("A1")) And IsNumeric(Target) Then
If Range("A1") <> 0 And Target.Value <> 0 Then
Text = "Pourcentage : " & Format(Target.Value / Range("A1"),
"percent")

Target.AddComment Text
End If
End If
End If

End Sub

'------------------------------------
Sub LesCommentaires(Rg As Range)
For Each c In Rg
c.ClearComments
If IsNumeric(c) Then
If c <> 0 Then
Text = "Pourcentage : " _
& Format(c.Value / Range("A1"), "percent")
c.AddComment Text
End If
End If
Next
End Sub
'------------------------------------






a écrit dans le message de
news:14c1f01c3fa01$0e0d74a0$

bonjour, je cherche à faire apparaitre l'interprétation
du résultat d'une cellule sur son commentaire.
par exemple :
sur la cellule a1 montant du budget total fixe
sur a2 montant budget janvier évolutif
sur a3 montant budget fevrier évolutif
.. etc
je veux voir en sélectionnant les cellules a2 puis
a3, ..etc l'évolution du pourcentage du budget du mois
sélectionné par rapport au budget total.
est-ce possible?




Avatar
garnote
C'est effectivement du plus bel effet si on les laisse affichés
et ça simplifie mes macros.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Column = 1 And Target.Row <> 1 Then Commentaires_Évolutifs
End Sub

Sub Commentaires_Évolutifs()
On Error Resume Next
Set ici = ActiveCell
If ici = "" Or Not IsNumeric(ici) Then
ici.ClearComments
Exit Sub
End If
t = Format(ici.Value / [a1], "percent")
With ici
.ClearComments
.AddComment
.Comment.Text Text:="Évolution: " & t
.Comment.Visible = True
.Comment.Shape.TextFrame.AutoSize = True
End With
End Sub

:-)
Serge

"michdenis" a écrit dans le message de news:
eEpWHeh#
Bonjour Garnote,

Le seul "hic" c'est que l'on doive réellement sélectionner la cellule pour
visualiser le commentaire ! M'enfin !!!



Salutations!


"garnote" a écrit dans le message de
news:jIn_b.74450$

Salut Denis,

J'ai un peu changé de fil !
Tes «publications» m'ont permis de «fioriturer» ma patente :

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Column <> 1 Then
Range("A:A").ClearComments
Else
If Target.Column = 1 And Target.Row <> 1 Then Commentaires_Évolutifs
End If
End Sub


Sub Commentaires_Évolutifs()
On Error Resume Next
Range("A:A").ClearComments
Set ici = ActiveCell
If ici = "" Or Not IsNumeric(ici) Then Exit Sub
t = Format(ici.Value / [a1], "percent")
With ici
.ClearComments
.AddComment
.Comment.Text Text:="Évolution: " & t
.Comment.Visible = True
.Comment.Shape.OLEFormat.Object.AutoSize = True
End With
End Sub

Serge


























"michdenis" a écrit dans le message de news:
uf2r1Hh#
Bonjour,

Dans le module feuille de ton classeur, copie ce qui suit :

Dans la procédure : Ces plages sont adaptées au besoin
En A1 = montant global
En A2:A12 Montant partiel

'------------------------------------
Private Sub Worksheet_Change(ByVal Target As Range)

Dim Rg As Range
Set Rg = Range("A2:A12")

If Target.Address = Range("A1").Address Then
If IsNumeric(Range("a1")) Then
If Range("A1") <> 0 Then
LesCommentaires Rg
End If
End If
End If

Set Rg = Intersect(Target, Range("A2:A12"))
If Not Rg Is Nothing Then
LesCommentaires Rg
End If
Set Rg = Nothing
End Sub
'------------------------------------
Private Sub Worksheet_SelectionChange(ByVal Target As Range)

If Not Intersect(Target, Range("A2:A12")) Is Nothing Then
If Target.Cells.Count > 1 Then Exit Sub
Target.ClearComments
If IsNumeric(Range("A1")) And IsNumeric(Target) Then
If Range("A1") <> 0 And Target.Value <> 0 Then
Text = "Pourcentage : " & Format(Target.Value / Range("A1"),
"percent")

Target.AddComment Text
End If
End If
End If

End Sub

'------------------------------------
Sub LesCommentaires(Rg As Range)
For Each c In Rg
c.ClearComments
If IsNumeric(c) Then
If c <> 0 Then
Text = "Pourcentage : " _
& Format(c.Value / Range("A1"), "percent")
c.AddComment Text
End If
End If
Next
End Sub
'------------------------------------






a écrit dans le message de
news:14c1f01c3fa01$0e0d74a0$

bonjour, je cherche à faire apparaitre l'interprétation
du résultat d'une cellule sur son commentaire.
par exemple :
sur la cellule a1 montant du budget total fixe
sur a2 montant budget janvier évolutif
sur a3 montant budget fevrier évolutif
.. etc
je veux voir en sélectionnant les cellules a2 puis
a3, ..etc l'évolution du pourcentage du budget du mois
sélectionné par rapport au budget total.
est-ce possible?









Avatar
Denis Michon
"C'est effectivement du plus bel effet si on les laisse affichés"

Tu n'as jamais si bien dit.... ils demeurent tous affichés ! WoW !

;-)


Salutations!



"garnote" a écrit dans le message de news:B7o_b.74455$
C'est effectivement du plus bel effet si on les laisse affichés
et ça simplifie mes macros.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Column = 1 And Target.Row <> 1 Then Commentaires_Évolutifs
End Sub

Sub Commentaires_Évolutifs()
On Error Resume Next
Set ici = ActiveCell
If ici = "" Or Not IsNumeric(ici) Then
ici.ClearComments
Exit Sub
End If
t = Format(ici.Value / [a1], "percent")
With ici
.ClearComments
.AddComment
.Comment.Text Text:="Évolution: " & t
.Comment.Visible = True
.Comment.Shape.TextFrame.AutoSize = True
End With
End Sub

:-)
Serge

"michdenis" a écrit dans le message de news:
eEpWHeh#
Bonjour Garnote,

Le seul "hic" c'est que l'on doive réellement sélectionner la cellule pour
visualiser le commentaire ! M'enfin !!!



Salutations!


"garnote" a écrit dans le message de
news:jIn_b.74450$

Salut Denis,

J'ai un peu changé de fil !
Tes «publications» m'ont permis de «fioriturer» ma patente :

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Column <> 1 Then
Range("A:A").ClearComments
Else
If Target.Column = 1 And Target.Row <> 1 Then Commentaires_Évolutifs
End If
End Sub


Sub Commentaires_Évolutifs()
On Error Resume Next
Range("A:A").ClearComments
Set ici = ActiveCell
If ici = "" Or Not IsNumeric(ici) Then Exit Sub
t = Format(ici.Value / [a1], "percent")
With ici
.ClearComments
.AddComment
.Comment.Text Text:="Évolution: " & t
.Comment.Visible = True
.Comment.Shape.OLEFormat.Object.AutoSize = True
End With
End Sub

Serge


























"michdenis" a écrit dans le message de news:
uf2r1Hh#
Bonjour,

Dans le module feuille de ton classeur, copie ce qui suit :

Dans la procédure : Ces plages sont adaptées au besoin
En A1 = montant global
En A2:A12 Montant partiel

'------------------------------------
Private Sub Worksheet_Change(ByVal Target As Range)

Dim Rg As Range
Set Rg = Range("A2:A12")

If Target.Address = Range("A1").Address Then
If IsNumeric(Range("a1")) Then
If Range("A1") <> 0 Then
LesCommentaires Rg
End If
End If
End If

Set Rg = Intersect(Target, Range("A2:A12"))
If Not Rg Is Nothing Then
LesCommentaires Rg
End If
Set Rg = Nothing
End Sub
'------------------------------------
Private Sub Worksheet_SelectionChange(ByVal Target As Range)

If Not Intersect(Target, Range("A2:A12")) Is Nothing Then
If Target.Cells.Count > 1 Then Exit Sub
Target.ClearComments
If IsNumeric(Range("A1")) And IsNumeric(Target) Then
If Range("A1") <> 0 And Target.Value <> 0 Then
Text = "Pourcentage : " & Format(Target.Value / Range("A1"),
"percent")

Target.AddComment Text
End If
End If
End If

End Sub

'------------------------------------
Sub LesCommentaires(Rg As Range)
For Each c In Rg
c.ClearComments
If IsNumeric(c) Then
If c <> 0 Then
Text = "Pourcentage : " _
& Format(c.Value / Range("A1"), "percent")
c.AddComment Text
End If
End If
Next
End Sub
'------------------------------------






a écrit dans le message de
news:14c1f01c3fa01$0e0d74a0$

bonjour, je cherche à faire apparaitre l'interprétation
du résultat d'une cellule sur son commentaire.
par exemple :
sur la cellule a1 montant du budget total fixe
sur a2 montant budget janvier évolutif
sur a3 montant budget fevrier évolutif
.. etc
je veux voir en sélectionnant les cellules a2 puis
a3, ..etc l'évolution du pourcentage du budget du mois
sélectionné par rapport au budget total.
est-ce possible?









Avatar
garnote
Se gausse-t-on de moi ?

:-)

Moé

"Denis Michon" a écrit dans le message de news:
mbo_b.74457$
"C'est effectivement du plus bel effet si on les laisse affichés"

Tu n'as jamais si bien dit.... ils demeurent tous affichés ! WoW !

;-)


Salutations!



"garnote" a écrit dans le message de
news:B7o_b.74455$

C'est effectivement du plus bel effet si on les laisse affichés
et ça simplifie mes macros.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Column = 1 And Target.Row <> 1 Then Commentaires_Évolutifs
End Sub

Sub Commentaires_Évolutifs()
On Error Resume Next
Set ici = ActiveCell
If ici = "" Or Not IsNumeric(ici) Then
ici.ClearComments
Exit Sub
End If
t = Format(ici.Value / [a1], "percent")
With ici
.ClearComments
.AddComment
.Comment.Text Text:="Évolution: " & t
.Comment.Visible = True
.Comment.Shape.TextFrame.AutoSize = True
End With
End Sub

:-)
Serge

"michdenis" a écrit dans le message de news:
eEpWHeh#
Bonjour Garnote,

Le seul "hic" c'est que l'on doive réellement sélectionner la cellule
pour


visualiser le commentaire ! M'enfin !!!


Salutations!


"garnote" a écrit dans le message de
news:jIn_b.74450$

Salut Denis,

J'ai un peu changé de fil !
Tes «publications» m'ont permis de «fioriturer» ma patente :

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Column <> 1 Then
Range("A:A").ClearComments
Else
If Target.Column = 1 And Target.Row <> 1 Then Commentaires_Évolutifs
End If
End Sub


Sub Commentaires_Évolutifs()
On Error Resume Next
Range("A:A").ClearComments
Set ici = ActiveCell
If ici = "" Or Not IsNumeric(ici) Then Exit Sub
t = Format(ici.Value / [a1], "percent")
With ici
.ClearComments
.AddComment
.Comment.Text Text:="Évolution: " & t
.Comment.Visible = True
.Comment.Shape.OLEFormat.Object.AutoSize = True
End With
End Sub

Serge


























"michdenis" a écrit dans le message de news:
uf2r1Hh#
Bonjour,

Dans le module feuille de ton classeur, copie ce qui suit :

Dans la procédure : Ces plages sont adaptées au besoin
En A1 = montant global
En A2:A12 Montant partiel

'------------------------------------
Private Sub Worksheet_Change(ByVal Target As Range)

Dim Rg As Range
Set Rg = Range("A2:A12")

If Target.Address = Range("A1").Address Then
If IsNumeric(Range("a1")) Then
If Range("A1") <> 0 Then
LesCommentaires Rg
End If
End If
End If

Set Rg = Intersect(Target, Range("A2:A12"))
If Not Rg Is Nothing Then
LesCommentaires Rg
End If
Set Rg = Nothing
End Sub
'------------------------------------
Private Sub Worksheet_SelectionChange(ByVal Target As Range)

If Not Intersect(Target, Range("A2:A12")) Is Nothing Then
If Target.Cells.Count > 1 Then Exit Sub
Target.ClearComments
If IsNumeric(Range("A1")) And IsNumeric(Target) Then
If Range("A1") <> 0 And Target.Value <> 0 Then
Text = "Pourcentage : " & Format(Target.Value /
Range("A1"),



"percent")
Target.AddComment Text
End If
End If
End If

End Sub

'------------------------------------
Sub LesCommentaires(Rg As Range)
For Each c In Rg
c.ClearComments
If IsNumeric(c) Then
If c <> 0 Then
Text = "Pourcentage : " _
& Format(c.Value / Range("A1"), "percent")
c.AddComment Text
End If
End If
Next
End Sub
'------------------------------------






a écrit dans le message de
news:14c1f01c3fa01$0e0d74a0$

bonjour, je cherche à faire apparaitre l'interprétation
du résultat d'une cellule sur son commentaire.
par exemple :
sur la cellule a1 montant du budget total fixe
sur a2 montant budget janvier évolutif
sur a3 montant budget fevrier évolutif
.. etc
je veux voir en sélectionnant les cellules a2 puis
a3, ..etc l'évolution du pourcentage du budget du mois
sélectionné par rapport au budget total.
est-ce possible?














Avatar
michdenis
"Se gausse-t-on de moi ?"

Absolument pas... mais un fait demeure, les commentaires s'affichent en permanence à l'écran !

N'était-ce pas de cet effet dont tu parlais ?

;-)


Salutations!



"garnote" a écrit dans le message de news:6io_b.74459$
Se gausse-t-on de moi ?

:-)

Moé

"Denis Michon" a écrit dans le message de news:
mbo_b.74457$
"C'est effectivement du plus bel effet si on les laisse affichés"

Tu n'as jamais si bien dit.... ils demeurent tous affichés ! WoW !

;-)


Salutations!



"garnote" a écrit dans le message de
news:B7o_b.74455$

C'est effectivement du plus bel effet si on les laisse affichés
et ça simplifie mes macros.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Column = 1 And Target.Row <> 1 Then Commentaires_Évolutifs
End Sub

Sub Commentaires_Évolutifs()
On Error Resume Next
Set ici = ActiveCell
If ici = "" Or Not IsNumeric(ici) Then
ici.ClearComments
Exit Sub
End If
t = Format(ici.Value / [a1], "percent")
With ici
.ClearComments
.AddComment
.Comment.Text Text:="Évolution: " & t
.Comment.Visible = True
.Comment.Shape.TextFrame.AutoSize = True
End With
End Sub

:-)
Serge

"michdenis" a écrit dans le message de news:
eEpWHeh#
Bonjour Garnote,

Le seul "hic" c'est que l'on doive réellement sélectionner la cellule
pour


visualiser le commentaire ! M'enfin !!!


Salutations!


"garnote" a écrit dans le message de
news:jIn_b.74450$

Salut Denis,

J'ai un peu changé de fil !
Tes «publications» m'ont permis de «fioriturer» ma patente :

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Column <> 1 Then
Range("A:A").ClearComments
Else
If Target.Column = 1 And Target.Row <> 1 Then Commentaires_Évolutifs
End If
End Sub


Sub Commentaires_Évolutifs()
On Error Resume Next
Range("A:A").ClearComments
Set ici = ActiveCell
If ici = "" Or Not IsNumeric(ici) Then Exit Sub
t = Format(ici.Value / [a1], "percent")
With ici
.ClearComments
.AddComment
.Comment.Text Text:="Évolution: " & t
.Comment.Visible = True
.Comment.Shape.OLEFormat.Object.AutoSize = True
End With
End Sub

Serge


























"michdenis" a écrit dans le message de news:
uf2r1Hh#
Bonjour,

Dans le module feuille de ton classeur, copie ce qui suit :

Dans la procédure : Ces plages sont adaptées au besoin
En A1 = montant global
En A2:A12 Montant partiel

'------------------------------------
Private Sub Worksheet_Change(ByVal Target As Range)

Dim Rg As Range
Set Rg = Range("A2:A12")

If Target.Address = Range("A1").Address Then
If IsNumeric(Range("a1")) Then
If Range("A1") <> 0 Then
LesCommentaires Rg
End If
End If
End If

Set Rg = Intersect(Target, Range("A2:A12"))
If Not Rg Is Nothing Then
LesCommentaires Rg
End If
Set Rg = Nothing
End Sub
'------------------------------------
Private Sub Worksheet_SelectionChange(ByVal Target As Range)

If Not Intersect(Target, Range("A2:A12")) Is Nothing Then
If Target.Cells.Count > 1 Then Exit Sub
Target.ClearComments
If IsNumeric(Range("A1")) And IsNumeric(Target) Then
If Range("A1") <> 0 And Target.Value <> 0 Then
Text = "Pourcentage : " & Format(Target.Value /
Range("A1"),



"percent")
Target.AddComment Text
End If
End If
End If

End Sub

'------------------------------------
Sub LesCommentaires(Rg As Range)
For Each c In Rg
c.ClearComments
If IsNumeric(c) Then
If c <> 0 Then
Text = "Pourcentage : " _
& Format(c.Value / Range("A1"), "percent")
c.AddComment Text
End If
End If
Next
End Sub
'------------------------------------






a écrit dans le message de
news:14c1f01c3fa01$0e0d74a0$

bonjour, je cherche à faire apparaitre l'interprétation
du résultat d'une cellule sur son commentaire.
par exemple :
sur la cellule a1 montant du budget total fixe
sur a2 montant budget janvier évolutif
sur a3 montant budget fevrier évolutif
.. etc
je veux voir en sélectionnant les cellules a2 puis
a3, ..etc l'évolution du pourcentage du budget du mois
sélectionné par rapport au budget total.
est-ce possible?














Avatar
garnote
Oui, tout à fait. ( m'en viens parano, stie ! )
Et une subsidiaire question :
Est-il possible de prévoir l'événement : Entrez une valeur
dans une cellule et la valider par une flèche de déplacement ?

:-)

Serge

"michdenis" a écrit dans le message de news:
#rE4Nwh#
"Se gausse-t-on de moi ?"

Absolument pas... mais un fait demeure, les commentaires s'affichent en
permanence à l'écran !


N'était-ce pas de cet effet dont tu parlais ?

;-)


Salutations!



"garnote" a écrit dans le message de
news:6io_b.74459$

Se gausse-t-on de moi ?

:-)

Moé

"Denis Michon" a écrit dans le message de news:
mbo_b.74457$
"C'est effectivement du plus bel effet si on les laisse affichés"

Tu n'as jamais si bien dit.... ils demeurent tous affichés ! WoW !

;-)


Salutations!



"garnote" a écrit dans le message de
news:B7o_b.74455$

C'est effectivement du plus bel effet si on les laisse affichés
et ça simplifie mes macros.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Column = 1 And Target.Row <> 1 Then Commentaires_Évolutifs
End Sub

Sub Commentaires_Évolutifs()
On Error Resume Next
Set ici = ActiveCell
If ici = "" Or Not IsNumeric(ici) Then
ici.ClearComments
Exit Sub
End If
t = Format(ici.Value / [a1], "percent")
With ici
.ClearComments
.AddComment
.Comment.Text Text:="Évolution: " & t
.Comment.Visible = True
.Comment.Shape.TextFrame.AutoSize = True
End With
End Sub

:-)
Serge

"michdenis" a écrit dans le message de news:
eEpWHeh#
Bonjour Garnote,

Le seul "hic" c'est que l'on doive réellement sélectionner la cellule
pour


visualiser le commentaire ! M'enfin !!!


Salutations!


"garnote" a écrit dans le message de
news:jIn_b.74450$

Salut Denis,

J'ai un peu changé de fil !
Tes «publications» m'ont permis de «fioriturer» ma patente :

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Column <> 1 Then
Range("A:A").ClearComments
Else
If Target.Column = 1 And Target.Row <> 1 Then
Commentaires_Évolutifs



End If
End Sub


Sub Commentaires_Évolutifs()
On Error Resume Next
Range("A:A").ClearComments
Set ici = ActiveCell
If ici = "" Or Not IsNumeric(ici) Then Exit Sub
t = Format(ici.Value / [a1], "percent")
With ici
.ClearComments
.AddComment
.Comment.Text Text:="Évolution: " & t
.Comment.Visible = True
.Comment.Shape.OLEFormat.Object.AutoSize = True
End With
End Sub

Serge


























"michdenis" a écrit dans le message de news:
uf2r1Hh#
Bonjour,

Dans le module feuille de ton classeur, copie ce qui suit :

Dans la procédure : Ces plages sont adaptées au besoin
En A1 = montant global
En A2:A12 Montant partiel

'------------------------------------
Private Sub Worksheet_Change(ByVal Target As Range)

Dim Rg As Range
Set Rg = Range("A2:A12")

If Target.Address = Range("A1").Address Then
If IsNumeric(Range("a1")) Then
If Range("A1") <> 0 Then
LesCommentaires Rg
End If
End If
End If

Set Rg = Intersect(Target, Range("A2:A12"))
If Not Rg Is Nothing Then
LesCommentaires Rg
End If
Set Rg = Nothing
End Sub
'------------------------------------
Private Sub Worksheet_SelectionChange(ByVal Target As Range)

If Not Intersect(Target, Range("A2:A12")) Is Nothing Then
If Target.Cells.Count > 1 Then Exit Sub
Target.ClearComments
If IsNumeric(Range("A1")) And IsNumeric(Target) Then
If Range("A1") <> 0 And Target.Value <> 0 Then
Text = "Pourcentage : " & Format(Target.Value /
Range("A1"),



"percent")
Target.AddComment Text
End If
End If
End If

End Sub

'------------------------------------
Sub LesCommentaires(Rg As Range)
For Each c In Rg
c.ClearComments
If IsNumeric(c) Then
If c <> 0 Then
Text = "Pourcentage : " _
& Format(c.Value / Range("A1"), "percent")
c.AddComment Text
End If
End If
Next
End Sub
'------------------------------------






a écrit dans le message de
news:14c1f01c3fa01$0e0d74a0$

bonjour, je cherche à faire apparaitre l'interprétation
du résultat d'une cellule sur son commentaire.
par exemple :
sur la cellule a1 montant du budget total fixe
sur a2 montant budget janvier évolutif
sur a3 montant budget fevrier évolutif
.. etc
je veux voir en sélectionnant les cellules a2 puis
a3, ..etc l'évolution du pourcentage du budget du mois
sélectionné par rapport au budget total.
est-ce possible?



















Avatar
Denis Michon
Est-il possible de prévoir l'événement

Cela devient de l'art divinatoire ! et là , je ne suis pas très doué !!
Si tu précisais, ce que tu désires faire ?


" valider par une flèche de déplacement "

Habituellement, cela ne cause aucun problème particulier


Salutations!


"garnote" a écrit dans le message de news:mTo_b.74461$
Oui, tout à fait. ( m'en viens parano, stie ! )
Et une subsidiaire question :
Est-il possible de prévoir l'événement : Entrez une valeur
dans une cellule et la valider par une flèche de déplacement ?

:-)

Serge

"michdenis" a écrit dans le message de news:
#rE4Nwh#
"Se gausse-t-on de moi ?"

Absolument pas... mais un fait demeure, les commentaires s'affichent en
permanence à l'écran !


N'était-ce pas de cet effet dont tu parlais ?

;-)


Salutations!



"garnote" a écrit dans le message de
news:6io_b.74459$

Se gausse-t-on de moi ?

:-)

Moé

"Denis Michon" a écrit dans le message de news:
mbo_b.74457$
"C'est effectivement du plus bel effet si on les laisse affichés"

Tu n'as jamais si bien dit.... ils demeurent tous affichés ! WoW !

;-)


Salutations!



"garnote" a écrit dans le message de
news:B7o_b.74455$

C'est effectivement du plus bel effet si on les laisse affichés
et ça simplifie mes macros.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Column = 1 And Target.Row <> 1 Then Commentaires_Évolutifs
End Sub

Sub Commentaires_Évolutifs()
On Error Resume Next
Set ici = ActiveCell
If ici = "" Or Not IsNumeric(ici) Then
ici.ClearComments
Exit Sub
End If
t = Format(ici.Value / [a1], "percent")
With ici
.ClearComments
.AddComment
.Comment.Text Text:="Évolution: " & t
.Comment.Visible = True
.Comment.Shape.TextFrame.AutoSize = True
End With
End Sub

:-)
Serge

"michdenis" a écrit dans le message de news:
eEpWHeh#
Bonjour Garnote,

Le seul "hic" c'est que l'on doive réellement sélectionner la cellule
pour


visualiser le commentaire ! M'enfin !!!


Salutations!


"garnote" a écrit dans le message de
news:jIn_b.74450$

Salut Denis,

J'ai un peu changé de fil !
Tes «publications» m'ont permis de «fioriturer» ma patente :

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Column <> 1 Then
Range("A:A").ClearComments
Else
If Target.Column = 1 And Target.Row <> 1 Then
Commentaires_Évolutifs



End If
End Sub


Sub Commentaires_Évolutifs()
On Error Resume Next
Range("A:A").ClearComments
Set ici = ActiveCell
If ici = "" Or Not IsNumeric(ici) Then Exit Sub
t = Format(ici.Value / [a1], "percent")
With ici
.ClearComments
.AddComment
.Comment.Text Text:="Évolution: " & t
.Comment.Visible = True
.Comment.Shape.OLEFormat.Object.AutoSize = True
End With
End Sub

Serge


























"michdenis" a écrit dans le message de news:
uf2r1Hh#
Bonjour,

Dans le module feuille de ton classeur, copie ce qui suit :

Dans la procédure : Ces plages sont adaptées au besoin
En A1 = montant global
En A2:A12 Montant partiel

'------------------------------------
Private Sub Worksheet_Change(ByVal Target As Range)

Dim Rg As Range
Set Rg = Range("A2:A12")

If Target.Address = Range("A1").Address Then
If IsNumeric(Range("a1")) Then
If Range("A1") <> 0 Then
LesCommentaires Rg
End If
End If
End If

Set Rg = Intersect(Target, Range("A2:A12"))
If Not Rg Is Nothing Then
LesCommentaires Rg
End If
Set Rg = Nothing
End Sub
'------------------------------------
Private Sub Worksheet_SelectionChange(ByVal Target As Range)

If Not Intersect(Target, Range("A2:A12")) Is Nothing Then
If Target.Cells.Count > 1 Then Exit Sub
Target.ClearComments
If IsNumeric(Range("A1")) And IsNumeric(Target) Then
If Range("A1") <> 0 And Target.Value <> 0 Then
Text = "Pourcentage : " & Format(Target.Value /
Range("A1"),



"percent")
Target.AddComment Text
End If
End If
End If

End Sub

'------------------------------------
Sub LesCommentaires(Rg As Range)
For Each c In Rg
c.ClearComments
If IsNumeric(c) Then
If c <> 0 Then
Text = "Pourcentage : " _
& Format(c.Value / Range("A1"), "percent")
c.AddComment Text
End If
End If
Next
End Sub
'------------------------------------






a écrit dans le message de
news:14c1f01c3fa01$0e0d74a0$

bonjour, je cherche à faire apparaitre l'interprétation
du résultat d'une cellule sur son commentaire.
par exemple :
sur la cellule a1 montant du budget total fixe
sur a2 montant budget janvier évolutif
sur a3 montant budget fevrier évolutif
.. etc
je veux voir en sélectionnant les cellules a2 puis
a3, ..etc l'évolution du pourcentage du budget du mois
sélectionné par rapport au budget total.
est-ce possible?



















1 2