1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| Private Sub OK_Click()
If ComboBox1 = "" Then
MsgBox ("VEUILLEZ SELECTIONNER LA SEMAINE A CREER")
Exit Sub
End If
For I = 1 To Sheets.Count
If UCase(Left(Sheets(I).Name, Len(ComboBox1))) = UCase(ComboBox1) Then
MsgBox ("La feuille " & UCase(ComboBox1) & " existe déjà, si vous désirez regénérer une feuille de données veuillez la supprimer avant toute action")
Exit Sub
End If
Next I
' Copie de la feuille "Reporting" sans les formules pour éviter que les données se mettent à jours
Application.ScreenUpdating = False
Sheets("Reporting").Copy after:=Sheets(Sheets.Count)
With ActiveSheet
.Name = UCase(ComboBox1) & "_" & Format(Now, "yyyy")
With .UsedRange
.Value = .Value
End With
End With
Unload Me
End Sub |
Partager