How do I get the index in a VBA For Each Loop (programming with Excel)? -


i working excel vba process data , here want make:

i want develop function can calculate out values in light-green area

in sheet, want create function "getdebutdate" can automatically calculate first date row has value.

for example, in row of "mark", first time value aug-05 number of "4".

i know few vba , after searching around found can use for ... each loop in range. how index of "v" in each loop? after index, how value of date in head row?

function get_board_count(range range)   each v in range     ....   next   get_board_count = .... end function 

you can alternatively use excel-only solution, doesn't need vba programming. have formula:

=indirect(address(1,match(true,index(a2:e2>0,0),0))) 

match(true,index(a2:e2>0,0),0) looks first value greater 0 , not null , returns current column index of value. rest of formula refers row, dates, wanted date per reference. in case first row...


Comments

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -