Excel formula to space out range depending on other variable -
right - tricky 1 phrase i'm going use couple of images me.
in columns , b varying list of team names , number of players each team has.
column d contains desired output.
i need formula, inserted cell d2 , dragged down far total of column b, return team names - but crucially allow number of rows beneath return blank. number of blank rows beneath equal 1 - number of players in team.
i have given thought, can't come suitable formula. ideas?
also suggestions better title welcome.
the following vba function want. let me know if part of not clear you.
sub teamrows() dim coldrownumber integer dim integer dim teamname string dim numberofrows integer dim howfar integer ' loop through teams in column howfar = application.worksheetfunction.counta(range("a:a")) ' variable keep count of rows in column d coldrownumber = 2 = 2 howfar ' team's name , number of rows teamname = range("a" & i).value numberofrows = range("b" & i).value ' fill in team's name in column d range("d" & coldrownumber).value = teamname ' increase row number number of empty rows required coldrownumber = coldrownumber + numberofrows next end sub
Comments
Post a Comment