excel - generating a sequence using array length and formatting date -


the following code using

with thisworkbook.worksheets(currentsheet)    lastrow = .cells(.rows.count, 2).end(xlup).row    .range("a1").offset(lastrow).resize(ubound(dates).value = application.transpose(sequence)    .range("a1").offset(lastrow, 1).resize(ubound(dates).value = application.transpose(dates) end       

in above code, dates array of random dates , want dump column 2 does. in column 1 need sequence, more of period kind of thing starts 1 every time , ends on length of dates array.

for e.g.

period    date   1      10/15/2000   2      10/17/2000   3      10/20/2000   4      10/25/2000 

in above example length of dates array 4 , hence period starts 1 , ends @ 4 simple giving serial number. can length of array using len or bounds confused on how can generate sequence 1 length of array. dates not in serial format, 20150716 tried formatting using

dateserial(left(dates(1), 4), mid(dates(i), 5, 2), right(dates(i), 2)) cells(range).numberformat = "mm/dd/yyyy" 

but 1 @ time, while need tpo dump entire array @ time , need convert entire array before transposing it. can please suggest function or idea job ? in advance.


Comments