Passer a la ligne suivante si cellule vide
Bonjour a tous,
Je sollicite votre aide car je rencontre des difficultes avec un code qui fonctionne tres bien mais par contre lorsque celle ci parcour la colonne E je souhaiterai que lorsque celle ci rencontre un cellule vide toujours en colonne E , passer a la suivante.
je vous joint un fichier afin d'etre precis
Merci d'avance
With ActiveSheet
n = .Range("c" & .Rows.Count).End(xlUp).Row
For i = 2 To n
j = 0
Do
'ton code... Exemple :
' BZ.WriteScreen .Cells(i + j, 3).Value, 2, 29
' BZ.WriteScreen .Cells(i + j, 5).Value, 2, 51
' BZ.WriteScreen .Cells(i + j, 6).Value, 5, 5
BZ.WriteScreen .Cells(i + j, 6).Value, 2, 11
BZ.SendKey "@E"
'-----------------------------------------------------------------------------------------------------------
'.Cells(1, CONSColumn + 1).FormulaR1C1 = "CONS Information"
'.Cells(1, CONSColumn + 1).Font.ColorIndex = 5
' .Cells(1, CONSColumn + 1).Font.Bold = True
'.Cells(1, CONSColumn + 2).Font.ColorIndex = 5
' .Cells(1, CONSColumn + 2).Font.Bold = True
ActiveWindow.Zoom = 75
.Cells(2, CONSColumn + 9).FormulaR1C1 = "Orig"
.Cells(2, CONSColumn + 10).FormulaR1C1 = "Dest"
.Cells(2, CONSColumn + 11).FormulaR1C1 = "Date"
.Cells(2, CONSColumn + 12).FormulaR1C1 = "Time(Z)"
.Cells(2, CONSColumn + 13).FormulaR1C1 = "CONS Unit"
.Cells(2, CONSColumn + 14).FormulaR1C1 = "Qty"
.Cells(2, CONSColumn + 15).FormulaR1C1 = "Statut"
BZ.ReadScreen DisplayText, 5, 3, 6 ' orig
.Cells(i + j, 9).Value = VBA.Trim(DisplayText)
BZ.ReadScreen DisplayText, 5, 3, 26 ' dest
.Cells(i + j, 10).Value = VBA.Trim(DisplayText)
BZ.ReadScreen DisplayText, 6, 2, 62 ' date
.Cells(i + j, 11).Value = VBA.Trim(DisplayText)
BZ.ReadScreen DisplayText, 4, 2, 77 ' Time
.Cells(i + j, 12).Value = VBA.Trim(DisplayText)
BZ.ReadScreen DisplayText, 15, 3, 47 ' Uld
.Cells(i + j, 13).Value = VBA.Trim(DisplayText)
BZ.ReadScreen DisplayText, 5, 3, 71 ' Qty
.Cells(i + j, 14).Value = VBA.Trim(DisplayText)
'**************************************************************************************************************
j = j + 1
Loop While .Cells(i + j, 2) = .Cells(i + j - 1, 2)
i = i + j - 1
BZ.SendKey "@E"
'BZ.pause 2
'********************************************************************************
Next i
.Range("c:c").Delete
Cells.EntireColumn.AutoFit ' redimionner colonne en auto
.PageSetup.Orientation = xlLandscape
.ResetAllPageBreaks
End With
End Sub
Merci , comme toujours c'est parfait