pascal21
XLDnaute Barbatruc
Code:
With Workbooks("pointages2.xls")
Application.ScreenUpdating = False
Dim i As Integer
For i = 1 To 10
Sheets(i).Select
Sheets(i).Range("C4:d38").ClearContents
Sheets(i).Range("f4:k38").ClearContents
Next i
Application.ScreenUpdating = True
End With
With Workbooks("pointages1.xls")
Application.ScreenUpdating = False
Dim a As Integer
For a = 1 To 10
Sheets(a).Select
Sheets(a).Range("C4:d38").ClearContents
Sheets(a).Range("f4:k38").ClearContents
Next a
Application.ScreenUpdating = True
End With
Workbooks("pointages1.xls").Sheets(1).Activate
Range("b4").Select
UserForm1.Show
avec ce code j'efface grâce à un bouton dans un usf qui est dans pointages1.xls, le contenu des feuilles 1 à 10 de mes 2 classeurs
cela ne fonctionne pas toujours très bien
certaines feuilles n'effacent pas du 1er coup
comment optimiser ce code pour obtenir un fonctionnement nickel ?
merci