G
Gysmo
Guest
Bonjour
J'ai cette macro qui fonctionne très bien sauf dans mon cas le nom des onglets s'appelle un nom ex : Pascal, André..... et non un chiffre
Dans la fonction IF quoi je doit changer pour être capable de la faire.
Sub Macro1()
Dim Somme As Long
Dim Ctr As Integer
Somme = 0
For Ctr = 1 To Sheets.Count
If (Sheets(Ctr).Name > 1000) And (Sheets(Ctr).Name < 9999) Then
Sheets(Ctr).Select
Somme = Somme + ActiveSheet.Range("D1").Value
End If
Next
Sheets("Result").Select
ActiveSheet.Range("A1").Value = Somme
End Sub
Merci
J'ai cette macro qui fonctionne très bien sauf dans mon cas le nom des onglets s'appelle un nom ex : Pascal, André..... et non un chiffre
Dans la fonction IF quoi je doit changer pour être capable de la faire.
Sub Macro1()
Dim Somme As Long
Dim Ctr As Integer
Somme = 0
For Ctr = 1 To Sheets.Count
If (Sheets(Ctr).Name > 1000) And (Sheets(Ctr).Name < 9999) Then
Sheets(Ctr).Select
Somme = Somme + ActiveSheet.Range("D1").Value
End If
Next
Sheets("Result").Select
ActiveSheet.Range("A1").Value = Somme
End Sub
Merci