Hi,
New to VBA here, getting error 424 object not found with this code after running, it runs only once perfectly but stops after 1 iteration. Consider "yyy" as all different variables (code I am using is below).
Any help would be appreciated
[TABLE="class: outer_border, width: 800"]
<tbody>[TR]
[TD]Sub DeleteSpecifcColumn()
Set MR = Range("A2:BT2")
For Each cell In MR
If cell.Value = "yyy" Then cell.EntireColumn.Delete
If cell.Value = "yyy" Then cell.EntireColumn.Delete
If cell.Value = "yyy" Then cell.EntireColumn.Delete
If cell.Value = "yyy" Then cell.EntireColumn.Delete
Next
End Sub
[/TD]
[/TR]
</tbody>[/TABLE]
Thanks in advance
New to VBA here, getting error 424 object not found with this code after running, it runs only once perfectly but stops after 1 iteration. Consider "yyy" as all different variables (code I am using is below).
Any help would be appreciated
[TABLE="class: outer_border, width: 800"]
<tbody>[TR]
[TD]Sub DeleteSpecifcColumn()
Set MR = Range("A2:BT2")
For Each cell In MR
If cell.Value = "yyy" Then cell.EntireColumn.Delete
If cell.Value = "yyy" Then cell.EntireColumn.Delete
If cell.Value = "yyy" Then cell.EntireColumn.Delete
If cell.Value = "yyy" Then cell.EntireColumn.Delete
Next
End Sub
[/TD]
[/TR]
</tbody>[/TABLE]
Thanks in advance