Biggest Challenge For Excel Experts

Satya Ranjan

New Member
Joined
Dec 23, 2015
Messages
26
Capture.jpg


Each line is to be repeated by the nos of qty and in each line qty will be 1.


Is there any way we can do this in excel?

Thanks
 
Re: If you are not a super expert in excel then this question is not for you.

Hi Mr Satya,

Try below code this code useful to you.

as per your above explanation your qty column qty reflect 4 and a,b,c are copy and pasted 4 time. that means you need to how much qty in qty column you need to paste this job code that time

Sorry my bad english

Sub Multiple_Qty()
Dim lRow As Long
Dim RepeatFactor As Variant


lRow = 1
Do While (Cells(lRow, "A") <> "")

RepeatFactor = Cells(lRow, "D")
If ((RepeatFactor > 1) And IsNumeric(RepeatFactor)) Then

Range(Cells(lRow, "A"), Cells(lRow, "D")).Copy
Range(Cells(lRow + 1, "A"), Cells(lRow + RepeatFactor - 1, "D")).Select
Selection.Insert Shift:=xlDown

lRow = lRow + RepeatFactor - 1
End If

lRow = lRow + 1
Loop
End Sub


pls try same correction done by above code
as per above coding you must on to changes as per your QTY column.
D" is Repeat Factor
 
Last edited:
Upvote 0

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
Re: If you are not a super expert in excel then this question is not for you.

This another different scenario to the previous ones.
We keep offering a solution to your issue and you have been responding with changes to the requirements.
I suggest you have a rethink on what you actually NEED.....then upload a before and after sample of data to a hosting site, so that someone may download and modify to suit......but it won't be me...:banghead: .....:outtahere:
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,333
Members
452,636
Latest member
laura12345

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top