1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
| Sub Auto_Open()
If Worksheets(1).Name = "Sommaire" Then
Application.DisplayAlerts = False
Worksheets(1).Delete
Application.DisplayAlerts = True
End If
Sheets.Add before:=Worksheets(1)
ActiveSheet.Name = "Sommaire"
[A1] = "Listing des clients en cours"
Range("A1").Font.Bold = True
Range("A1").Font.Size = 18
Range("A1").Font.Underline = xlUnderlineStyleSingle
Dim ligne As Integer
ligne = 3
Dim numero As Integer
numero = 1
Dim feuille As Worksheet
For Each feuille In Worksheets
Cells(ligne, 1) = numero
ActiveSheet.Hyperlinks.Add anchor:=Cells(ligne, 2), Address:="", SubAddress:="'" & feuille.Name & "'!A1", TextToDisplay:=feuille.Name
ligne = ligne + 1
numero = 1 + numero
Cells(ligne, 5) = "TEST-DATE"
Cells(ligne, 6).Formula = 1 + 1
Next
Dim nbLignes As Integer
nbLignes = Cells(Application.Rows.Count, 1).End(xlUp).Row
Range("A65536").End(xlUp)(2).Formula = "Nb clients"
Range("B65536").End(xlUp)(2).Formula = nbLignes - 5
End Sub |
Partager