Insert rows - fastest approaches

JackDanIce

Well-known Member
Joined
Feb 3, 2010
Messages
9,922
Office Version
  1. 365
Platform
  1. Windows
Hi,

Writing a macro that lifts specific columns from a source sheet into a destination sheet. Unable to find decent answer online, though may not be asking in way that returns meaningful results.

One column is date at start of week (Monday) followed by daily hours in adjacent columns

I'd like to transpose daily hours into rows as fast as possible.

Unable to download software to show screen, so best text attempt:

Source Sheet (~7,000 rows like below from opened workbook)
Name Date Total Hours Mon Tue Wed Thur Fri Sat Sun
Jack Daniels 16/04/2018 40 7.5 7.5 7.5 7.5 7.5 0 2.5

Destination Sheet: (macro runs in this workbook and opens source sheet first; the destination sheet should finish with 7x row count from source sheet)
Name Date Hours
Jack Daniels 16/04/2018 7.5
Jack Daniels 17/04/2018 7.5
Jack Daniels 18/04/2018 7.5
Jack Daniels 19/04/2018 7.5
Jack Daniels 20/04/2018 7.5
Jack Daniels 21/04/2018 0
Jack Daniels 22/04/2018 2.5

(Destination sheet doesn't need total hours)

Any suggestions on shortest time for transform process?

Unsure if:
#1 Copy all data first, then use For Loop with Step 6 to insert required rows or
#2 Iterate through source data (normal For Loop) and copy each row to destination but add 6 to destination row after each copy operation

Thank you in advance,
Jack
 
Probably not explaining myself clearly enough and using short descriptions to address the problem than the bigger picture.

It's cool, you've given me something to consider in conjunction with Fluff's original which I've adjusted to work with set up here, all good thank you!
OK, great. :)
 
Upvote 0

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop

Forum statistics

Threads
1,224,827
Messages
6,181,194
Members
453,021
Latest member
pingpong7117

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