Hi,
I need to do a couple of do whiles with an IF that validate if a cell it's equal to a number (locations codes) then delete the entire row, (I need them in 2 different macros)
And the issue is that I have 90 locations codes (for now) So, how can I create this kind of "database" as simple as it could be and make it part of my code
I.e. some locations codes are: CA1405, CE8574, MN7891, RC1020, PR5471, LK6871 ... etc.
That's what I have.
Thank you very much !!! any help will be very apreciate.
I need to do a couple of do whiles with an IF that validate if a cell it's equal to a number (locations codes) then delete the entire row, (I need them in 2 different macros)
And the issue is that I have 90 locations codes (for now) So, how can I create this kind of "database" as simple as it could be and make it part of my code
I.e. some locations codes are: CA1405, CE8574, MN7891, RC1020, PR5471, LK6871 ... etc.
That's what I have.
Code:
Allrows = Range("A" & Rows.Count).End(xlUp).row
Dim fila As Integer
fila = 2
Do While (fila <= Allrows)
rango1 = "D" & CStr(fila)
Allrows = Range("A" & Rows.Count).End(xlUp).row
If (Range(rango1) = [COLOR=seagreen]"Locations codes"[/COLOR]) Then
Rows(fila).Select
Selection.Delete Shift:=xlUp
fila = fila - 1
End If
fila = fila + 1
Loop