MErci ca marche nikel pour la detection
par contre je bug sur l'intégration dans mon code.
En fait je voudrais une macro qui insére une feuille 'sommaire' si elle n'existe pas et execute ma macro, sinon je vais dedans, j'efface tout, et j'execute ma macro.
si tu as le temps de regarder ca donne :
Sub creationsommaire()
Dim SH As Worksheet
Dim Ligne As Long
Dim i As Integer
For i = 1 To Sheets.Count
If Sheets(i).Name = 'Sommaire' Then
insertionfeuille
Else
Sheets.Add
ActiveSheet.Select
ActiveSheet.Name = 'Sommaire'
insertionfeuille
Exit Sub
End If
Next
End Sub
Sub insertionfeuille()
Worksheets('Sommaire').Activate
Ligne = 2
For Each SH In Worksheets
If SH.Index >= 2 Then
Ligne = Ligne + 2
ActiveSheet.Hyperlinks.Add Anchor:=Range('A' & Ligne), Address:='', SubAddress:=''' & SH.Name & ''' & '!A1', TextToDisplay:=SH.Name
Worksheets('Sommaire').Select
Cells.Select
With Selection.Interior
.ColorIndex = 15
.Pattern = xlSolid
End With
Selection.Font.Underline = xlUnderlineStyleSingle
Selection.Font.Underline = xlUnderlineStyleNone
Selection.Font.Bold = True
Selection.Font.ColorIndex = 55
Cells.EntireColumn.AutoFit
End If
Next
End Sub