excel vba - Decrement in for each loop -
is possible decrement in each loop in vba excel?
i have code this:
sub makro1()  dim rng range dim row range dim cell range  set rng = range("b1:f18")  each row in rng.rows     if worksheetfunction.counta(row) = 0         row.entirerow.delete         'previous row     end if next row  end sub   and want step in commented statement. possible?
no.
you have use for...next loop , step backwards:
dim long = rng.rows.count 1 step -1     set row = rng.rows(i)     if worksheetfunction.counta(row) = 0         row.entirerow.delete         'previous row     end if next      
Comments
Post a Comment