Simplifier ma macro (fermeture rapide)

  • Initiateur de la discussion Initiateur de la discussion mozz
  • 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 !

M

mozz

Guest
Bonjour à tous et toutes,

D'abord un grand merci pour votre magnifique travail, c'est génial.

Mon problème :

Ma macro met trop de temps à se fermer. Comment réduire sa taille ?

Sub salairesvierges()
Sheets("10-48b").Select
Range("A1:AD22").ClearComments
Range("B3:M8").ClearContents
Range("P6:AD20").ClearContents
Range("C3:M8", "P6:R20").Select
With Selection.Interior
.ColorIndex = xlNone
End With
Range("C2😀8").Select
With Selection.Interior
.ColorIndex = 37
End With
Range("F3:F20").Select
With Selection.Interior
.ColorIndex = 1
End With
Range("O3:O20").Select
With Selection.Interior
.ColorIndex = 1
End With
Sheets("10-49").Select
Range("A1:AD22").ClearComments
Range("B3:M8").ClearContents
Range("P6:AD20").ClearContents
Range("C3:M8", "P6:R20").Select
With Selection.Interior
.ColorIndex = xlNone
End With

With Selection.Interior
.ColorIndex = 37
End With
Range("F3:F20").Select
With Selection.Interior
.ColorIndex = 1
End With
Range("O3:O20").Select
With Selection.Interior
.ColorIndex = 1
End With
Sheets("10-50").Select
Range("A1:AD22").ClearComments
Range("B3:M8").ClearContents
Range("P6:AD20").ClearContents
Range("C3:M8", "P6:R20").Select
With Selection.Interior
.ColorIndex = xlNone
End With
Range("C3😀7").Select
With Selection.Interior
.ColorIndex = 37
End With
Range("F3:F20").Select
With Selection.Interior
.ColorIndex = 1
End With
Range("O3:O20").Select
With Selection.Interior
.ColorIndex = 1
End With
Sheets("10-51").Select
Range("A1:AD22").ClearComments
Range("B3:M8").ClearContents
Range("P6:AD20").ClearContents
Range("C3:M8", "P6:R20").Select
With Selection.Interior
.ColorIndex = xlNone
End With
Range("C3😀8").Select
With Selection.Interior
.ColorIndex = 37
End With
Range("F3:F20").Select
With Selection.Interior
.ColorIndex = 1
End With
Range("O3:O20").Select
With Selection.Interior
.ColorIndex = 1
End With
Sheets("10-52").Select
Range("A1:AD22").ClearComments
Range("B3:M8").ClearContents
Range("P6:AD20").ClearContents
Range("C3:M8", "P6:R20").Select
With Selection.Interior
.ColorIndex = xlNone
End With
Range("C3😀8").Select
With Selection.Interior
.ColorIndex = 37
End With
Range("F3:F20").Select
With Selection.Interior
.ColorIndex = 1
End With
Range("O3:O20").Select
With Selection.Interior
.ColorIndex = 1
End With
Sheets("10-48b").Select
Range("B3").Select
End Sub
 
Dernière modification par un modérateur:
Re : Simplifier ma macro (fermeture rapide)

bonjour,
tu peux déja simplifier

Range("C3:M8", "P6:R20").Select
With Selection.Interior
.ColorIndex = xlNone
End With
par :
Range("C3:M8", "P6:R20").Interior.ColorIndex = xlNone

Sheets("10-48b").Select
Range("B3").Select
par :
Sheets("10-48b").Range("B3").Select
 
Re : Simplifier ma macro (fermeture rapide)

bonjour à tous 🙂

bertrand, ca marche pas ca : Sheets("10-48b").Range("B3").Select

tu ne peux pas sélectionner une cellule d'une feuille distante sans avoir sélectionner la feuille avant.

tu pourrais faire comme ceci :

Application.Goto reference:=Sheets("10-48b").Range("B3")

salut
 
- 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
Assurez vous de marquer un message comme solution pour une meilleure transparence.

Discussions similaires

L
Réponses
9
Affichages
1 K
J
Réponses
22
Affichages
3 K
jui42
J
F
Réponses
8
Affichages
3 K
F
A
Réponses
2
Affichages
1 K
AntoineLTO
A
M
Réponses
8
Affichages
2 K
Michelrib
M
T
Réponses
28
Affichages
4 K
Retour