pablo1235185
New Member
- Joined
- Dec 18, 2017
- Messages
- 1
Hello,
I have structured my code in the following way (see below) to erase all the cells that appear with the number: "0". However, it also erases the lines that are empty (without a number or letter) and those i want to keep them. If anyone could help me to identify the mistake under my code tell me where is it. Thanks!!
Dim x, y As Long
Dim feuille As String
Sheets("tdb").Select
y = 3
While Cells(15, y) <> "EP"
feuille = Cells(15, y).Value
Sheets(feuille).Select
x = 1
While Cells(x, 1) <> "x"
If Cells(x, 6) = 0 And Cells(x, 6) = 0 <> "" And Cells(x, 5) = 0 And Cells(x, 5) = 0 <> "" Then
Rows(x).Delete
x = x - 1
End If
x = x + 1
Wend
y = y + 1
Sheets("tdb").Select
Wend
End Sub
I have structured my code in the following way (see below) to erase all the cells that appear with the number: "0". However, it also erases the lines that are empty (without a number or letter) and those i want to keep them. If anyone could help me to identify the mistake under my code tell me where is it. Thanks!!
Dim x, y As Long
Dim feuille As String
Sheets("tdb").Select
y = 3
While Cells(15, y) <> "EP"
feuille = Cells(15, y).Value
Sheets(feuille).Select
x = 1
While Cells(x, 1) <> "x"
If Cells(x, 6) = 0 And Cells(x, 6) = 0 <> "" And Cells(x, 5) = 0 And Cells(x, 5) = 0 <> "" Then
Rows(x).Delete
x = x - 1
End If
x = x + 1
Wend
y = y + 1
Sheets("tdb").Select
Wend
End Sub