Hello everybody
I have a value in A1
and a table of how to distribute this value ...
I don't know how to explain well so here's an attachment:
Hello everybody
I have a value in A1
and a table of how to distribute this value ...
I don't know how to explain well so here's an attachment:
You can probably do this with a formula but it's beyond meSub x() Dim r As Range For Each r In Range("B1", Range("B" & Rows.Count).End(xlUp)) Range("G" & Rows.Count).End(xlUp)(2).Resize(r.Offset(, 1)) = r Next r End Sub
Just add this after the Next lineI can do a formula if your table is only ever 4 rows but not if this is variable.Range("G1").Delete shift:=xlUp
=IF(ROWS($H$1:H1)>SUM($C$1:$C$4),"",IF(ROWS($H$1:H1)>SUM($C$1:$C$3),B$4,IF(ROWS($H$1:H1)>SUM($C$1:$C$2),B$3,IF(ROWS($H$1:H1)>SUM($C$1:$C$1),B$2,B$1))))
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks