Fonction IsEmpty

I

imej-clavier

Bonjour,
Quelqu'un peut-il comprendre mon problème ? J'ai essayé la fonction IsEmpty
dans le cas
suivant :
For i = 1 To Worksheets.Count
Worksheets(i).Cells.Select
If IsEmpty(Worksheets(i).Cells.Select) = True Then
' J'ai essayé Worksheets(i).Delete

Workbooks("SupprFeuilVides.xls").Worksheets(i).Delete
ActiveWindow.SelectedSheeets.Delete
'Aucune de ces instructiions ne fonctionne. Le programme
n'exécute pas ces lignes.
'Il exécute la suite du programme (il ne supprime pas les
feuilles vides)
Else
Worksheets(i+1).Select
End If
Next i
D'avance merci pour la réponse,

Jean-michel
 
N

Norman Jones

Bonjour Jean-michel,

Si j'ai bien compris, vous pouvez essayer:

Sub Tester()
Dim WS As Worksheet

Application.DisplayAlerts = False

For Each WS In Workbooks("SupprFeuilVides.xls").Worksheets
If Application.CountA(WS.Cells) = 0 Then
WS.Delete
End If
Next WS
Application.DisplayAlerts = True

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top