skillipo
Messages postés29Date d'inscriptionjeudi 23 novembre 2006StatutMembreDernière intervention14 avril 2008
-
5 déc. 2007 à 12:09
jmfmarques
Messages postés7666Date d'inscriptionsamedi 5 novembre 2005StatutMembreDernière intervention22 août 2014
-
6 déc. 2007 à 09:56
Bonjour,
j'ai une erreur d'execution 1004 voici mon code
<!-- BEGIN TEMPLATE: bbcode_code -->
Code :
<!--[if !IE]><--><!----><!--[endif]--><!--[if IE]>
<![endif]--> For i = LastLine To 8 Step -1 ' from the last line to line number 8
If xlApp.Application.WorksheetFunction.CountA(xlApp.Rows(i)) = 0 Then xlApp.Rows(i).Delete 'delete the Empty lines
If IsEmpty(Cells(B, i) And Cells(C, i) And Cells(D, i) And Cells(F, i) And Cells(H, i) And Cells(M, i) And Cells(N, i) And Cells(Q, i) And Cells(R, i) And Cells(S, i) And Cells(T, i) And Cells(U, i) And Cells(V, i)) Then sht.Range("X" & i).Value = "Error"
Next i
<!-- END TEMPLATE: bbcode_code -->
j'ai un erreur au niveau des multiple "AND" , je voudrais que si toute les cellules sont vide alors je rajoute ERROR .
cs_casy
Messages postés7741Date d'inscriptionmercredi 1 septembre 2004StatutMembreDernière intervention24 septembre 201440 5 déc. 2007 à 12:21
A priori, je dirais que ce n'est pas If IsEmpty(Cells(B, i) And Cells(C, i) And ..... mais plutot If IsEmpty(Cells(B, i)) And IsEmpty(Cells(C, i)) And IsEmpty(Cells(D, i)) And ......
skillipo
Messages postés29Date d'inscriptionjeudi 23 novembre 2006StatutMembreDernière intervention14 avril 2008 5 déc. 2007 à 13:58
'Suppression de ligne vide
Dim LastLine As Long, i As Long
LastLine = xlApp.ActiveSheet.UsedRange.Row - 1
MsgBox "last line = " & LastLine
LastLine = LastLine + xlApp.ActiveSheet.UsedRange.Rows.Count
MsgBox "last line 2 = " & LastLine
For i = LastLine To 8 Step -1 ' from the last line to line number 8
MsgBox "Compteur =" & i
If xlApp.Application.WorksheetFunction.CountA(xlApp.Rows(i)) = 0 Then xlApp.Rows(i).Delete 'delete the Empty lines
If IsEmpty(Cells(B, i)) And IsEmpty(Cells(C, i)) And IsEmpty(Cells(D, i)) And IsEmpty(Cells(F, i)) And IsEmpty(Cells(H, i)) And IsEmpty(Cells(M, i)) And IsEmpty(Cells(N, i)) And IsEmpty(Cells(Q, i)) And IsEmpty(Cells(R, i)) And IsEmpty(Cells(S, i)) And IsEmpty(Cells(T, i)) And IsEmpty(Cells(U, i)) And IsEmpty(Cells(V, i)) Then MsgBox "Ligne numero : " & i 'sht.Range("X" & i).Value = "Error"
Next i
j'ai essyé comme ca mais ca ne fonctionne pas non plu.