Page 1 of 1

issue of replication

Posted: Tue Aug 03, 2021 11:19 am
by sna
Hi Dear,
I have a problem how to return output base on cell value.
I have attached a template


Note:I don't need helper column because I can do it with that helper

Thanks

Re: issue of replication

Posted: Tue Aug 03, 2021 6:21 pm
by norkaz
...

D1

=IFERROR(INDEX($A$1:$A$4,AGGREGATE(15,6,ROW($B$1:$B$4)/($B$1:$B$4>=COLUMN($A$1:$Z$1)),ROW(A1)))&"-"&ROW(A2)-INDEX(LOOKUP(ROW($A$1:$A$20),MATCH($A$1:$A$4,INDEX($A$1:$A$4,AGGREGATE(15,6,ROW($B$1:$B$4)/($B$1:$B$4>=COLUMN($A$1:$Z$1)),ROW($A$1:$A$20))),0)),ROW(A1)),"")

Norkaz

Re: issue of replication

Posted: Wed Aug 04, 2021 6:20 am
by sna

Code: Select all

Try...

Thanks for formula but it is rather complex.no w I try to write code to accomplish but it seems not fine.here below code
Sub nn()
   Dim i As Long, j As Long
   For i = Range("A" & Rows.Count).End(xlUp).Row To 1 Step -1
      Rows(i).Copy
      Rows(i).Resize(Range("B" & i)).Insert
      For j = 0 To Range("B" & i).Value
         Range("E" & i + j).Value = Range("E" & i + j) & "-"& j+1
      Next j
   Next i
End Sub

Re: issue of replication

Posted: Thu Aug 05, 2021 10:49 pm
by sna
the formula works.thanks
one more who can help me with the code, what is wrong?

Re: issue of replication

Posted: Fri Aug 06, 2021 6:32 am
by snasui
:D Please attach the latest file that already have your code inside again for another member easy to review.