How to duplicate rows

btamulis

New Member
Joined
Mar 17, 2010
Messages
17
Interesting scenario -

I have a spreadsheet with one column - 35,000 unique item numbers

Example:

item a
item b
item c
item d
item e

I need to duplicate each row - making a spreadshhet with one column 70,000 rows as such:

item a
item a
item b
item b
item c
item c
item d
item d
item e
item e

I tried a formula - couldn't come up with anything - looked for some kind of merge type functionality - did find anything........

Any guidance would be appreciated........
<!-- / message --><!-- BEGIN TEMPLATE: ad_showthread_firstpost_sig --><!-- END TEMPLATE: ad_showthread_firstpost_sig -->
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
Copy and paste a duplicate column underneath the original, then sort the entire data set.
 
Upvote 0
Try

Code:
Sub InsRows()
Dim LR As Long, i As Long
LR = Range("A" & Rows.Count).End(xlUp).Row
Application.ScreenUpdating = False
For i = LR To 1 Step -1
    Rows(i).Copy
    Rows(i).Insert
Next i
Application.ScreenUpdating = True
End Sub
 
Upvote 0
Peter - how do i change my worksheet to exceed the 65,000+ rows - the code errored out - I think because my rows = 38,365 which when doubled goes to 76,730.........I am on excel 2007 - so I do have capability
 
Upvote 0
Make sure to save the file in one of the 2007 formats - xlsx or xlsm - first.
 
Upvote 0

Forum statistics

Threads
1,224,595
Messages
6,179,798
Members
452,943
Latest member
Newbie4296

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