Hello,
I have the code below running perfectly until the situation reaches one of the condition second to last which is the "8CNT"
if it is met then for some reason if the "9END." is met also, it is not run but if the "8CNT" is not met then the "9END." does run
Is it because im basically hopping or skipping over that c value at that moment that i just deleted??? how can i avoid that... ive seen where it is best to work backwards as to not miss it but i dont know how to set that up
I have the code below running perfectly until the situation reaches one of the condition second to last which is the "8CNT"
if it is met then for some reason if the "9END." is met also, it is not run but if the "8CNT" is not met then the "9END." does run
Code:
Set headers = Sheets("DATA").Range("C8:K8")
For Each c In headers
If c.Value = "0BEG" Then
c.Value = "Starting Quantity"
ElseIf c.Value = "3XFI" Then
c.Value = "Transfer Quantity"
ElseIf c.Value = "4RTN" Then
c.Value = "Returned Quantity"
ElseIf c.Value = "5ADI" Then
c.Value = "Adjusted Quantity (+)"
ElseIf c.Value = "2SAL" Then
c.Value = "Sold Quantity"
ElseIf c.Value = "3XFO" Then
c.Value = "Picked Quantity"
ElseIf c.Value = "5ADO" Then
c.Value = "Adjusted Quantity (-)"
ElseIf c.Value = "7FRZ" Then
c.Value = "Ending Quantity"
ElseIf c.Value = "2POR" Then
c.Value = "Purchased Quantity"
[COLOR=#ff0000][B] ElseIf c.Value = "8CNT" Then[/B][/COLOR]
[COLOR=#ff0000][B] c.EntireColumn.Delete[/B][/COLOR]
[COLOR=#ff0000][B] ElseIf c.Value = "9END." Then[/B][/COLOR]
[COLOR=#ff0000][B] c.EntireColumn.Delete[/B][/COLOR]
End If
Next
Is it because im basically hopping or skipping over that c value at that moment that i just deleted??? how can i avoid that... ive seen where it is best to work backwards as to not miss it but i dont know how to set that up
Last edited: