Modif Macro

Bonjour à tous

Dans une macro, à la fin, je souhaiterais faire changer de feuille active (Nom de feuille : AffichageCoches)

Quelle commande dois-je écrire ?

Voici la macro :

Sub ImprimerMédailles2Fois()

'

' ImprimerMédailles2Fois Macro

'

If Range("AL5").Value = 1 Then

Call FormaterVitesse

Else

If Range("AL7").Value = 1 Then

Call FormaterDemiFond

Else

If Range("AL9").Value = 1 Then

Call FormaterPoids

Else

If Range("AL11").Value = 1 Then

Call FormaterHauteur

Else

If Range("AL13").Value = 1 Then

Call FormaterCorde

Else

If Range("AL55").Value = 1 Then

Call FormaterPSSP

Else: End If

End If

End If

End If

End If

End If

MsgBox "Je vais imprimer 2 exemplaires"

Application.ScreenUpdating = False

ActiveSheet.Unprotect

Range("Ac2:AH17").Select

Range("AH17").Activate

ActiveSheet.PageSetup.PrintArea = "$AC$2:$AH$17"

ActiveWindow.SelectedSheets.PrintOut Copies:=2, Collate:=True, _

IgnorePrintAreas:=False

Range("I1").Select

ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True

Application.ScreenUpdating = True

MsgBox "Pensez à complèter la fiche de suivi !"

End Sub

Bonjour,

Avec ce code :

Sheets("AffichageCoches").activate

Bonjour Raja

Avec cette commande, j'ai un défaut d’exécution 9

soit l'indice n'appartient pas à la séléction

Re,

Cela veut dire que l'onglet n'existe pas. Si tu veux plus d'aide, merci de joindre ton fichier.

Merci beaucoup RAJA

Mon onglet existait bien sous ce nom mais avec un espace à la fin que je n'avais pas vu

Merci encore

Rechercher des sujets similaires à "modif macro"