Ceci est une page optimisée pour les mobiles. Cliquez sur ce texte pour afficher la vraie page.

Probleme installation de macro

  • Initiateur de la discussion Initiateur de la discussion scoob67
  • Date de début Date de début

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 !

scoob67

XLDnaute Nouveau
Bonjour je tente d'installer cette macro et jai toujours une message d'erreur de compilation a la ligne 11, par contre cette meme macro est utilisé par une autre personne et n'a aucun problème...

Pouvez-vous m'aider?

Sub Macro1()


Cells.Select

With Application.FindFormat.Font

.Subscript = False

.ColorIndex = 3

End With

With Application.ReplaceFormat.Font

.Subscript = False

.ColorIndex = 4

End With

Selection.Replace What:="", Replacement:="", LookAt:=xlPart, SearchOrder _

:=xlByRows, MatchCase:=False, SearchFormat:=True, ReplaceFormat:=True

With Application.FindFormat.Font

.Subscript = False

.ColorIndex = 5

End With

With Application.ReplaceFormat.Font

.Subscript = False

.ColorIndex = 3

End With

Application.FindFormat.Clear

Application.ReplaceFormat.Clear

With Application.FindFormat.Font

.Subscript = False

.ColorIndex = 19

End With

With Application.ReplaceFormat.Font

.Subscript = False

.ColorIndex = 2

End With

Selection.Replace What:="", Replacement:="", LookAt:=xlPart, SearchOrder _

:=xlByRows, MatchCase:=False, SearchFormat:=True, ReplaceFormat:=True

Application.FindFormat.Clear

Application.ReplaceFormat.Clear

Application.FindFormat.Interior.ColorIndex = 19

Application.ReplaceFormat.Interior.ColorIndex = xlNone

Selection.Replace What:="", Replacement:="", LookAt:=xlPart, SearchOrder _

:=xlByRows, MatchCase:=False, SearchFormat:=True, ReplaceFormat:=True

Application.FindFormat.Interior.ColorIndex = 20

With Application.ReplaceFormat.Interior

.ColorIndex = 15

.Pattern = xlSolid

End With

Selection.Replace What:="", Replacement:="", LookAt:=xlPart, SearchOrder _

:=xlByRows, MatchCase:=False, SearchFormat:=True, ReplaceFormat:=True

Application.FindFormat.Interior.ColorIndex = 24

With Application.ReplaceFormat.Interior

.ColorIndex = 11

.Pattern = xlSolid

End With

With Application.ReplaceFormat.Font

.Subscript = False

.ColorIndex = 2

End With

Selection.Replace What:="", Replacement:="", LookAt:=xlPart, SearchOrder _

:=xlByRows, MatchCase:=False, SearchFormat:=True, ReplaceFormat:=True

Application.FindFormat.Clear

Application.ReplaceFormat.Clear

With Application.FindFormat.Font

.Subscript = False

.ColorIndex = 11

End With

With Application.ReplaceFormat.Font

.Subscript = False

.ColorIndex = 3

End With

Selection.Replace What:="", Replacement:="", LookAt:=xlPart, SearchOrder _

:=xlByRows, MatchCase:=False, SearchFormat:=True, ReplaceFormat:=True

With Application.FindFormat.Font

.Subscript = False

.ColorIndex = 5

End With

Selection.Replace What:="", Replacement:="", LookAt:=xlPart, SearchOrder _

:=xlByRows, MatchCase:=False, SearchFormat:=True, ReplaceFormat:=True

End Sub
 
Re : Probleme installation de macro

Bonsoir scoob67, bienvenue sur XLD,

Des retours à la ligne étaient tout simplement mal placés après SearchOrder. Vous n'avez pas dû chercher beaucoup 🙂

Code:
Sub Macro1()


Cells.Select

With Application.FindFormat.Font

.Subscript = False

.ColorIndex = 3

End With

With Application.ReplaceFormat.Font

.Subscript = False

.ColorIndex = 4

End With

Selection.Replace What:="", Replacement:="", LookAt:=xlPart, SearchOrder:= _
xlByRows, MatchCase:=False, SearchFormat:=True, ReplaceFormat:=True

With Application.FindFormat.Font

.Subscript = False

.ColorIndex = 5

End With

With Application.ReplaceFormat.Font

.Subscript = False

.ColorIndex = 3

End With

Application.FindFormat.Clear

Application.ReplaceFormat.Clear

With Application.FindFormat.Font

.Subscript = False

.ColorIndex = 19

End With

With Application.ReplaceFormat.Font

.Subscript = False

.ColorIndex = 2

End With

Selection.Replace What:="", Replacement:="", LookAt:=xlPart, SearchOrder:= _
xlByRows, MatchCase:=False, SearchFormat:=True, ReplaceFormat:=True

Application.FindFormat.Clear

Application.ReplaceFormat.Clear

Application.FindFormat.Interior.ColorIndex = 19

Application.ReplaceFormat.Interior.ColorIndex = xlNone

Selection.Replace What:="", Replacement:="", LookAt:=xlPart, SearchOrder:= _
xlByRows, MatchCase:=False, SearchFormat:=True, ReplaceFormat:=True

Application.FindFormat.Interior.ColorIndex = 20

With Application.ReplaceFormat.Interior

.ColorIndex = 15

.Pattern = xlSolid

End With

Selection.Replace What:="", Replacement:="", LookAt:=xlPart, SearchOrder:= _
xlByRows, MatchCase:=False, SearchFormat:=True, ReplaceFormat:=True

Application.FindFormat.Interior.ColorIndex = 24

With Application.ReplaceFormat.Interior

.ColorIndex = 11

.Pattern = xlSolid

End With

With Application.ReplaceFormat.Font

.Subscript = False

.ColorIndex = 2

End With

Selection.Replace What:="", Replacement:="", LookAt:=xlPart, SearchOrder:= _
xlByRows, MatchCase:=False, SearchFormat:=True, ReplaceFormat:=True

Application.FindFormat.Clear

Application.ReplaceFormat.Clear

With Application.FindFormat.Font

.Subscript = False

.ColorIndex = 11

End With

With Application.ReplaceFormat.Font

.Subscript = False

.ColorIndex = 3

End With

Selection.Replace What:="", Replacement:="", LookAt:=xlPart, SearchOrder:= _
xlByRows, MatchCase:=False, SearchFormat:=True, ReplaceFormat:=True

With Application.FindFormat.Font

.Subscript = False

.ColorIndex = 5

End With

Selection.Replace What:="", Replacement:="", LookAt:=xlPart, SearchOrder:= _
xlByRows, MatchCase:=False, SearchFormat:=True, ReplaceFormat:=True

End Sub

A+
 
- 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
2
Affichages
474
Réponses
1
Affichages
281
Réponses
3
Affichages
544
Réponses
12
Affichages
866
Les cookies sont requis pour utiliser ce site. Vous devez les accepter pour continuer à utiliser le site. En savoir plus…