Split cell value into multiple rows based on condition

Read That Dt say DT1

Use Build Datatable Say DT2 and add all colums of DT1
UseFor Each Row DT1
Assign Quant=Cint(Row(“Quantity”).ToString)
while
Quant>2000
Then Add Data Row To DT2
AS first 5 columns blank say in Data Array = {“”,“”,“”,“”,“”,2000,"KGM}
Then use assign Quant=Quant-2000

out of while
Add data row Data Array = {“”,“”,“”,“”,“”,Quant,"KGM}

Then use Write range

1 Like