JackDanIce
Well-known Member
- Joined
- Feb 3, 2010
- Messages
- 9,922
- Office Version
- 365
- Platform
- 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
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