J'ai dans une feuille les deux macros suivantes :
'''Date Création enregistrement
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect([A2:A65000], Target) Is Nothing And Target.Count = 1 Then
Application.EnableEvents = False
Target.Offset(0, 9) = Now
Application.EnableEvents = True
End If
End Sub
''' Forçer Majuscule
Private Sub Worksheet_Change(ByVal zz As Range)
If Intersect(zz, [a2:I6000]) Is Nothing Then Exit Sub
Application.EnableEvents = False
zz = UCase(zz)
Application.EnableEvents = True
End Sub
l'une inscrit la date de saisie, l'autre force l'enregistrement en Maj.
L'erreur suivante apparait : "Erreur de compilation : Nom ambiguë détecté
(Worksheet_Change).
je pense comprendre pourquoi mais ne sais pas y remédier...
Cette action est irreversible, confirmez la suppression du commentaire ?
Signaler le commentaire
Veuillez sélectionner un problème
Nudité
Violence
Harcèlement
Fraude
Vente illégale
Discours haineux
Terrorisme
Autre
FFO
Salut à toi
Mets les codes ensembles ainsi :
Private Sub Worksheet_Change(ByVal Target As Range,ByVal zz As Range) If Not Intersect([A2:A65000], Target) Is Nothing And Target.Count = 1 Then Application.EnableEvents = False Target.Offset(0, 9) = Now Application.EnableEvents = True End If If Intersect(zz, [a2:I6000]) Is Nothing Then Exit Sub Application.EnableEvents = False zz = UCase(zz) Application.EnableEvents = True End Sub
Celà devrait faire
Fais des essais et dis moi !!!!
Salut à toi
Mets les codes ensembles ainsi :
Private Sub Worksheet_Change(ByVal Target As Range,ByVal zz As Range)
If Not Intersect([A2:A65000], Target) Is Nothing And Target.Count =
1 Then
Application.EnableEvents = False
Target.Offset(0, 9) = Now
Application.EnableEvents = True
End If
If Intersect(zz, [a2:I6000]) Is Nothing Then Exit Sub
Application.EnableEvents = False
zz = UCase(zz)
Application.EnableEvents = True
End Sub
Private Sub Worksheet_Change(ByVal Target As Range,ByVal zz As Range) If Not Intersect([A2:A65000], Target) Is Nothing And Target.Count = 1 Then Application.EnableEvents = False Target.Offset(0, 9) = Now Application.EnableEvents = True End If If Intersect(zz, [a2:I6000]) Is Nothing Then Exit Sub Application.EnableEvents = False zz = UCase(zz) Application.EnableEvents = True End Sub
Celà devrait faire
Fais des essais et dis moi !!!!
MichD
Bonjour,
Tu ne peux pas avoir 2 macros événementielles identiques dans le même module
Combine le code de tes 2 macros comme ceci :
'--------------------------------- Private Sub Worksheet_Change(ByVal Target As Range) If Not Intersect([A2:A65000], Target) Is Nothing And Target.Count = 1 Then Application.EnableEvents = False Target.Offset(0, 9) = Now Application.EnableEvents = True End If If Intersect(Target, [a2:I6000]) Is Nothing Then Exit Sub Application.EnableEvents = False Target = UCase(Target) Application.EnableEvents = True
End Sub '---------------------------------
MichD -------------------------------------------- "Jol" a écrit dans le message de groupe de discussion : iqjdcq$nmo$
Bonjour,
J'ai dans une feuille les deux macros suivantes : '''Date Création enregistrement Private Sub Worksheet_Change(ByVal Target As Range) If Not Intersect([A2:A65000], Target) Is Nothing And Target.Count = 1 Then Application.EnableEvents = False Target.Offset(0, 9) = Now Application.EnableEvents = True End If End Sub
''' Forçer Majuscule Private Sub Worksheet_Change(ByVal zz As Range) If Intersect(zz, [a2:I6000]) Is Nothing Then Exit Sub Application.EnableEvents = False zz = UCase(zz) Application.EnableEvents = True End Sub
l'une inscrit la date de saisie, l'autre force l'enregistrement en Maj.
L'erreur suivante apparait : "Erreur de compilation : Nom ambiguë détecté (Worksheet_Change). je pense comprendre pourquoi mais ne sais pas y remédier...
Merci
Bonjour,
Tu ne peux pas avoir 2 macros événementielles identiques dans le même module
Combine le code de tes 2 macros comme ceci :
'---------------------------------
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect([A2:A65000], Target) Is Nothing And Target.Count = 1 Then
Application.EnableEvents = False
Target.Offset(0, 9) = Now
Application.EnableEvents = True
End If
If Intersect(Target, [a2:I6000]) Is Nothing Then Exit Sub
Application.EnableEvents = False
Target = UCase(Target)
Application.EnableEvents = True
End Sub
'---------------------------------
MichD
--------------------------------------------
"Jol" a écrit dans le message de groupe de discussion : iqjdcq$nmo$1@speranza.aioe.org...
Bonjour,
J'ai dans une feuille les deux macros suivantes :
'''Date Création enregistrement
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect([A2:A65000], Target) Is Nothing And Target.Count = 1 Then
Application.EnableEvents = False
Target.Offset(0, 9) = Now
Application.EnableEvents = True
End If
End Sub
''' Forçer Majuscule
Private Sub Worksheet_Change(ByVal zz As Range)
If Intersect(zz, [a2:I6000]) Is Nothing Then Exit Sub
Application.EnableEvents = False
zz = UCase(zz)
Application.EnableEvents = True
End Sub
l'une inscrit la date de saisie, l'autre force l'enregistrement en Maj.
L'erreur suivante apparait : "Erreur de compilation : Nom ambiguë détecté
(Worksheet_Change).
je pense comprendre pourquoi mais ne sais pas y remédier...
Tu ne peux pas avoir 2 macros événementielles identiques dans le même module
Combine le code de tes 2 macros comme ceci :
'--------------------------------- Private Sub Worksheet_Change(ByVal Target As Range) If Not Intersect([A2:A65000], Target) Is Nothing And Target.Count = 1 Then Application.EnableEvents = False Target.Offset(0, 9) = Now Application.EnableEvents = True End If If Intersect(Target, [a2:I6000]) Is Nothing Then Exit Sub Application.EnableEvents = False Target = UCase(Target) Application.EnableEvents = True
End Sub '---------------------------------
MichD -------------------------------------------- "Jol" a écrit dans le message de groupe de discussion : iqjdcq$nmo$
Bonjour,
J'ai dans une feuille les deux macros suivantes : '''Date Création enregistrement Private Sub Worksheet_Change(ByVal Target As Range) If Not Intersect([A2:A65000], Target) Is Nothing And Target.Count = 1 Then Application.EnableEvents = False Target.Offset(0, 9) = Now Application.EnableEvents = True End If End Sub
''' Forçer Majuscule Private Sub Worksheet_Change(ByVal zz As Range) If Intersect(zz, [a2:I6000]) Is Nothing Then Exit Sub Application.EnableEvents = False zz = UCase(zz) Application.EnableEvents = True End Sub
l'une inscrit la date de saisie, l'autre force l'enregistrement en Maj.
L'erreur suivante apparait : "Erreur de compilation : Nom ambiguë détecté (Worksheet_Change). je pense comprendre pourquoi mais ne sais pas y remédier...
Merci
Jol
Merci à vous deux,
MichD, ta macro fonctionne parfaitement à ceci près que si je supprime une ligne dans ma table j'ai un erreur d'exécution 13 et bien sûr la macro ne foctionne plus.
Pour FFO ça ne fonctionne pas...
"MichD" a écrit dans le message de news:iqjf84$vdl$
Bonjour,
Tu ne peux pas avoir 2 macros événementielles identiques dans le même module
Combine le code de tes 2 macros comme ceci :
'--------------------------------- Private Sub Worksheet_Change(ByVal Target As Range) If Not Intersect([A2:A65000], Target) Is Nothing And Target.Count = 1 Then Application.EnableEvents = False Target.Offset(0, 9) = Now Application.EnableEvents = True End If If Intersect(Target, [a2:I6000]) Is Nothing Then Exit Sub Application.EnableEvents = False Target = UCase(Target) Application.EnableEvents = True
End Sub '---------------------------------
MichD -------------------------------------------- "Jol" a écrit dans le message de groupe de discussion : iqjdcq$nmo$
Bonjour,
J'ai dans une feuille les deux macros suivantes : '''Date Création enregistrement Private Sub Worksheet_Change(ByVal Target As Range) If Not Intersect([A2:A65000], Target) Is Nothing And Target.Count = 1 Then Application.EnableEvents = False Target.Offset(0, 9) = Now Application.EnableEvents = True End If End Sub
''' Forçer Majuscule Private Sub Worksheet_Change(ByVal zz As Range) If Intersect(zz, [a2:I6000]) Is Nothing Then Exit Sub Application.EnableEvents = False zz = UCase(zz) Application.EnableEvents = True End Sub
l'une inscrit la date de saisie, l'autre force l'enregistrement en Maj.
L'erreur suivante apparait : "Erreur de compilation : Nom ambiguë détecté (Worksheet_Change). je pense comprendre pourquoi mais ne sais pas y remédier...
Merci
Merci à vous deux,
MichD, ta macro fonctionne parfaitement à ceci près que si je supprime une
ligne dans ma table j'ai un erreur d'exécution 13 et bien sûr la macro ne
foctionne plus.
Pour FFO ça ne fonctionne pas...
"MichD" <michdenis@hotmail.com> a écrit dans le message de
news:iqjf84$vdl$1@speranza.aioe.org...
Bonjour,
Tu ne peux pas avoir 2 macros événementielles identiques dans le même
module
Combine le code de tes 2 macros comme ceci :
'---------------------------------
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect([A2:A65000], Target) Is Nothing And Target.Count = 1 Then
Application.EnableEvents = False
Target.Offset(0, 9) = Now
Application.EnableEvents = True
End If
If Intersect(Target, [a2:I6000]) Is Nothing Then Exit Sub
Application.EnableEvents = False
Target = UCase(Target)
Application.EnableEvents = True
End Sub
'---------------------------------
MichD
--------------------------------------------
"Jol" a écrit dans le message de groupe de discussion :
iqjdcq$nmo$1@speranza.aioe.org...
Bonjour,
J'ai dans une feuille les deux macros suivantes :
'''Date Création enregistrement
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect([A2:A65000], Target) Is Nothing And Target.Count = 1
Then
Application.EnableEvents = False
Target.Offset(0, 9) = Now
Application.EnableEvents = True
End If
End Sub
''' Forçer Majuscule
Private Sub Worksheet_Change(ByVal zz As Range)
If Intersect(zz, [a2:I6000]) Is Nothing Then Exit Sub
Application.EnableEvents = False
zz = UCase(zz)
Application.EnableEvents = True
End Sub
l'une inscrit la date de saisie, l'autre force l'enregistrement en Maj.
L'erreur suivante apparait : "Erreur de compilation : Nom ambiguë détecté
(Worksheet_Change).
je pense comprendre pourquoi mais ne sais pas y remédier...
MichD, ta macro fonctionne parfaitement à ceci près que si je supprime une ligne dans ma table j'ai un erreur d'exécution 13 et bien sûr la macro ne foctionne plus.
Pour FFO ça ne fonctionne pas...
"MichD" a écrit dans le message de news:iqjf84$vdl$
Bonjour,
Tu ne peux pas avoir 2 macros événementielles identiques dans le même module
Combine le code de tes 2 macros comme ceci :
'--------------------------------- Private Sub Worksheet_Change(ByVal Target As Range) If Not Intersect([A2:A65000], Target) Is Nothing And Target.Count = 1 Then Application.EnableEvents = False Target.Offset(0, 9) = Now Application.EnableEvents = True End If If Intersect(Target, [a2:I6000]) Is Nothing Then Exit Sub Application.EnableEvents = False Target = UCase(Target) Application.EnableEvents = True
End Sub '---------------------------------
MichD -------------------------------------------- "Jol" a écrit dans le message de groupe de discussion : iqjdcq$nmo$
Bonjour,
J'ai dans une feuille les deux macros suivantes : '''Date Création enregistrement Private Sub Worksheet_Change(ByVal Target As Range) If Not Intersect([A2:A65000], Target) Is Nothing And Target.Count = 1 Then Application.EnableEvents = False Target.Offset(0, 9) = Now Application.EnableEvents = True End If End Sub
''' Forçer Majuscule Private Sub Worksheet_Change(ByVal zz As Range) If Intersect(zz, [a2:I6000]) Is Nothing Then Exit Sub Application.EnableEvents = False zz = UCase(zz) Application.EnableEvents = True End Sub
l'une inscrit la date de saisie, l'autre force l'enregistrement en Maj.
L'erreur suivante apparait : "Erreur de compilation : Nom ambiguë détecté (Worksheet_Change). je pense comprendre pourquoi mais ne sais pas y remédier...
Merci
MichD
Essaie comme ceci :
Je n'avais fait que transcrire et combiner les 2 macros ;-)
'---------------------------------- Private Sub Worksheet_Change(ByVal Target As Range) Dim Rg As Range, C As Range If Not Intersect([A2:A65000], Target) Is Nothing And Target.Count = 1 Then Application.EnableEvents = False Target.Offset(0, 9) = Now Application.EnableEvents = True End If
Set Rg = Intersect(Target, [a2:I6000]) If Not Rg Is Nothing Then Application.EnableEvents = False For Each C In Rg If Not IsEmpty(C) Then C = UCase(C) End If Next Application.EnableEvents = True End If End Sub '----------------------------------
MichD -------------------------------------------- "Jol" a écrit dans le message de groupe de discussion : iqji6t$ca2$
Merci à vous deux,
MichD, ta macro fonctionne parfaitement à ceci près que si je supprime une ligne dans ma table j'ai un erreur d'exécution 13 et bien sûr la macro ne foctionne plus.
Pour FFO ça ne fonctionne pas...
"MichD" a écrit dans le message de news:iqjf84$vdl$
Bonjour,
Tu ne peux pas avoir 2 macros événementielles identiques dans le même module
Combine le code de tes 2 macros comme ceci :
'--------------------------------- Private Sub Worksheet_Change(ByVal Target As Range) If Not Intersect([A2:A65000], Target) Is Nothing And Target.Count = 1 Then Application.EnableEvents = False Target.Offset(0, 9) = Now Application.EnableEvents = True End If If Intersect(Target, [a2:I6000]) Is Nothing Then Exit Sub Application.EnableEvents = False Target = UCase(Target) Application.EnableEvents = True
End Sub '---------------------------------
MichD -------------------------------------------- "Jol" a écrit dans le message de groupe de discussion : iqjdcq$nmo$
Bonjour,
J'ai dans une feuille les deux macros suivantes : '''Date Création enregistrement Private Sub Worksheet_Change(ByVal Target As Range) If Not Intersect([A2:A65000], Target) Is Nothing And Target.Count = 1 Then Application.EnableEvents = False Target.Offset(0, 9) = Now Application.EnableEvents = True End If End Sub
''' Forçer Majuscule Private Sub Worksheet_Change(ByVal zz As Range) If Intersect(zz, [a2:I6000]) Is Nothing Then Exit Sub Application.EnableEvents = False zz = UCase(zz) Application.EnableEvents = True End Sub
l'une inscrit la date de saisie, l'autre force l'enregistrement en Maj.
L'erreur suivante apparait : "Erreur de compilation : Nom ambiguë détecté (Worksheet_Change). je pense comprendre pourquoi mais ne sais pas y remédier...
Merci
Essaie comme ceci :
Je n'avais fait que transcrire et combiner les 2 macros
;-)
'----------------------------------
Private Sub Worksheet_Change(ByVal Target As Range)
Dim Rg As Range, C As Range
If Not Intersect([A2:A65000], Target) Is Nothing And Target.Count = 1 Then
Application.EnableEvents = False
Target.Offset(0, 9) = Now
Application.EnableEvents = True
End If
Set Rg = Intersect(Target, [a2:I6000])
If Not Rg Is Nothing Then
Application.EnableEvents = False
For Each C In Rg
If Not IsEmpty(C) Then
C = UCase(C)
End If
Next
Application.EnableEvents = True
End If
End Sub
'----------------------------------
MichD
--------------------------------------------
"Jol" a écrit dans le message de groupe de discussion : iqji6t$ca2$1@speranza.aioe.org...
Merci à vous deux,
MichD, ta macro fonctionne parfaitement à ceci près que si je supprime une
ligne dans ma table j'ai un erreur d'exécution 13 et bien sûr la macro ne
foctionne plus.
Pour FFO ça ne fonctionne pas...
"MichD" <michdenis@hotmail.com> a écrit dans le message de
news:iqjf84$vdl$1@speranza.aioe.org...
Bonjour,
Tu ne peux pas avoir 2 macros événementielles identiques dans le même
module
Combine le code de tes 2 macros comme ceci :
'---------------------------------
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect([A2:A65000], Target) Is Nothing And Target.Count = 1 Then
Application.EnableEvents = False
Target.Offset(0, 9) = Now
Application.EnableEvents = True
End If
If Intersect(Target, [a2:I6000]) Is Nothing Then Exit Sub
Application.EnableEvents = False
Target = UCase(Target)
Application.EnableEvents = True
End Sub
'---------------------------------
MichD
--------------------------------------------
"Jol" a écrit dans le message de groupe de discussion :
iqjdcq$nmo$1@speranza.aioe.org...
Bonjour,
J'ai dans une feuille les deux macros suivantes :
'''Date Création enregistrement
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect([A2:A65000], Target) Is Nothing And Target.Count = 1
Then
Application.EnableEvents = False
Target.Offset(0, 9) = Now
Application.EnableEvents = True
End If
End Sub
''' Forçer Majuscule
Private Sub Worksheet_Change(ByVal zz As Range)
If Intersect(zz, [a2:I6000]) Is Nothing Then Exit Sub
Application.EnableEvents = False
zz = UCase(zz)
Application.EnableEvents = True
End Sub
l'une inscrit la date de saisie, l'autre force l'enregistrement en Maj.
L'erreur suivante apparait : "Erreur de compilation : Nom ambiguë détecté
(Worksheet_Change).
je pense comprendre pourquoi mais ne sais pas y remédier...
Je n'avais fait que transcrire et combiner les 2 macros ;-)
'---------------------------------- Private Sub Worksheet_Change(ByVal Target As Range) Dim Rg As Range, C As Range If Not Intersect([A2:A65000], Target) Is Nothing And Target.Count = 1 Then Application.EnableEvents = False Target.Offset(0, 9) = Now Application.EnableEvents = True End If
Set Rg = Intersect(Target, [a2:I6000]) If Not Rg Is Nothing Then Application.EnableEvents = False For Each C In Rg If Not IsEmpty(C) Then C = UCase(C) End If Next Application.EnableEvents = True End If End Sub '----------------------------------
MichD -------------------------------------------- "Jol" a écrit dans le message de groupe de discussion : iqji6t$ca2$
Merci à vous deux,
MichD, ta macro fonctionne parfaitement à ceci près que si je supprime une ligne dans ma table j'ai un erreur d'exécution 13 et bien sûr la macro ne foctionne plus.
Pour FFO ça ne fonctionne pas...
"MichD" a écrit dans le message de news:iqjf84$vdl$
Bonjour,
Tu ne peux pas avoir 2 macros événementielles identiques dans le même module
Combine le code de tes 2 macros comme ceci :
'--------------------------------- Private Sub Worksheet_Change(ByVal Target As Range) If Not Intersect([A2:A65000], Target) Is Nothing And Target.Count = 1 Then Application.EnableEvents = False Target.Offset(0, 9) = Now Application.EnableEvents = True End If If Intersect(Target, [a2:I6000]) Is Nothing Then Exit Sub Application.EnableEvents = False Target = UCase(Target) Application.EnableEvents = True
End Sub '---------------------------------
MichD -------------------------------------------- "Jol" a écrit dans le message de groupe de discussion : iqjdcq$nmo$
Bonjour,
J'ai dans une feuille les deux macros suivantes : '''Date Création enregistrement Private Sub Worksheet_Change(ByVal Target As Range) If Not Intersect([A2:A65000], Target) Is Nothing And Target.Count = 1 Then Application.EnableEvents = False Target.Offset(0, 9) = Now Application.EnableEvents = True End If End Sub
''' Forçer Majuscule Private Sub Worksheet_Change(ByVal zz As Range) If Intersect(zz, [a2:I6000]) Is Nothing Then Exit Sub Application.EnableEvents = False zz = UCase(zz) Application.EnableEvents = True End Sub
l'une inscrit la date de saisie, l'autre force l'enregistrement en Maj.
L'erreur suivante apparait : "Erreur de compilation : Nom ambiguë détecté (Worksheet_Change). je pense comprendre pourquoi mais ne sais pas y remédier...
Merci
Jol
En te remerciant MichD, c'est parfait.
"Jol" a écrit dans le message de news:iqjdcq$nmo$
Bonjour,
J'ai dans une feuille les deux macros suivantes : '''Date Création enregistrement Private Sub Worksheet_Change(ByVal Target As Range) If Not Intersect([A2:A65000], Target) Is Nothing And Target.Count = 1 Then Application.EnableEvents = False Target.Offset(0, 9) = Now Application.EnableEvents = True End If End Sub
''' Forçer Majuscule Private Sub Worksheet_Change(ByVal zz As Range) If Intersect(zz, [a2:I6000]) Is Nothing Then Exit Sub Application.EnableEvents = False zz = UCase(zz) Application.EnableEvents = True End Sub
l'une inscrit la date de saisie, l'autre force l'enregistrement en Maj.
L'erreur suivante apparait : "Erreur de compilation : Nom ambiguë détecté (Worksheet_Change). je pense comprendre pourquoi mais ne sais pas y remédier...
Merci
En te remerciant MichD, c'est parfait.
"Jol" <angmedia@free.fr> a écrit dans le message de
news:iqjdcq$nmo$1@speranza.aioe.org...
Bonjour,
J'ai dans une feuille les deux macros suivantes :
'''Date Création enregistrement
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect([A2:A65000], Target) Is Nothing And Target.Count = 1
Then
Application.EnableEvents = False
Target.Offset(0, 9) = Now
Application.EnableEvents = True
End If
End Sub
''' Forçer Majuscule
Private Sub Worksheet_Change(ByVal zz As Range)
If Intersect(zz, [a2:I6000]) Is Nothing Then Exit Sub
Application.EnableEvents = False
zz = UCase(zz)
Application.EnableEvents = True
End Sub
l'une inscrit la date de saisie, l'autre force l'enregistrement en Maj.
L'erreur suivante apparait : "Erreur de compilation : Nom ambiguë détecté
(Worksheet_Change).
je pense comprendre pourquoi mais ne sais pas y remédier...
J'ai dans une feuille les deux macros suivantes : '''Date Création enregistrement Private Sub Worksheet_Change(ByVal Target As Range) If Not Intersect([A2:A65000], Target) Is Nothing And Target.Count = 1 Then Application.EnableEvents = False Target.Offset(0, 9) = Now Application.EnableEvents = True End If End Sub
''' Forçer Majuscule Private Sub Worksheet_Change(ByVal zz As Range) If Intersect(zz, [a2:I6000]) Is Nothing Then Exit Sub Application.EnableEvents = False zz = UCase(zz) Application.EnableEvents = True End Sub
l'une inscrit la date de saisie, l'autre force l'enregistrement en Maj.
L'erreur suivante apparait : "Erreur de compilation : Nom ambiguë détecté (Worksheet_Change). je pense comprendre pourquoi mais ne sais pas y remédier...