Friday, 15 April 2011

Autofill excel date after entering month of -



Autofill excel date after entering month of -

i creating excel template , want auto populate dates in table.

above line dates included written in ex. 10/01/14 - 10/31/14.

i want dates in table filled in when come in dates.

do need create 2 cells, 1 start date , 1 end date?

what formula need use?

select cell containing pair of dates separated dash , run little macro:

sub datemaker() dim v string, d1 date, d2 date, long v = activecell.text ary = split(v, "-") d1 = datevalue(trim(ary(0))) d2 = datevalue(trim(ary(1))) set r = activecell.offset(1, 0) = 1 rows.count r.value = d1 d1 = d1 + 1 if d1 > d2 exit sub set r = r.offset(1, 0) next end sub

excel date excel-formula formula

No comments:

Post a Comment