i want write loop deletes entire rows in sheet clean-up file. if have row 1 10, want delete row 1, 3, 5, 7, 9.
sub deleteeveryotherrow() x = 1 10 rows("x:x").select selection.delete shift:=xlup x = x + 2 next x end sub
"x:x" literal string, not work expect.
use rows(x & ":" & x).select instead.
you should consider running loop backwards 10 1:
for x = 9 1 step -2
otherwise you'll indexing tangled up. you'll able remove line x = x + 2.
Comments
Post a Comment