loops - VBA to increase the year after it finds a D -
i have data j14(january 14) until d14 in column c2:c13. want date increase 1 each time ran goes d14 j15 f15 etc sheet 5 contains j-d in column a1:12 , 14 in b1:b12 range c2:c13 drop down 1 each run also
below have works jan15
sub test() dim srchrng range, cel range dim lastrow string lastrow = activesheet.cells(rows.count, "c").end(xlup).row + 1 set srchrng = range("c2:c13") each cel in srchrng if instr(1, cel.value, "d") > 0 cel.offset(1, 50).value = range("c" & lastrow).select activecell.formula = "=sheet5!a1&sheet5!b1+1" end if next cel end sub
Comments
Post a Comment