Hi guys,
I'm looking for some help writing a macro to import CSV data into a master sheet (called individual load). I'll describe as best I can how I would like it to work. Copies of the documents can be found and downloaded from the link at the bottom of the post.
The data is from 34 participants in an exercise study. Each day they complete a certain amount of exercise which is quantified using 6 variables (DUR,TD,HID,SPR,HR,PL) which are recorded daily and updated into a weekly sheet (Week 1, Week 2, Week 3.....Week 52, as available at the link below). The weekly sheets are all of the exact same layout. What I would like to do is have a macro to import selected variables from the weekly sheets into the individual load sheet, which is used as a longitudinal record of all the parameters.
The example "individual load" sheet I have included shows the longitudinal layout for the TD and HID parameters. So for example, the TD values from Monday in week 1 (D20:D53) need to be imported to I11:I44. The HID values in week 1 (E20:E53) need to be imported to I51:I84. Each subsequent parameter (SPR, HR, PL [DUR does not need to be imported]) would need to be imported into the correct day but underneath TD and HID.
Week 2 data for each parameter would need to be imported into the week 2 ranges in the individual load sheet (column P to V). The current import macro on the sheet requires that all data must be reimported each time data is updated. So for example, when wanting to add Week 35's data, all 35 weekly CSV files must be selected so that the values occupy the correct spaces. I don't have a problem with having to do this but if there was an option where only the CSV file of interest had to be imported that would be great.
Also of note, I may be changing the number of parameters from 6 to 8, so an easy to edit code would be great to allow me to make changes and accomodate extra parameters. Any help or advice would be hugely appreciated. I'm using Excel 2010.
Thanks
Richard
https://drive.google.com/folderview?id=0B62oOa7h0BprMDFhYjdQbFJRbUE&usp=sharing
I'm looking for some help writing a macro to import CSV data into a master sheet (called individual load). I'll describe as best I can how I would like it to work. Copies of the documents can be found and downloaded from the link at the bottom of the post.
The data is from 34 participants in an exercise study. Each day they complete a certain amount of exercise which is quantified using 6 variables (DUR,TD,HID,SPR,HR,PL) which are recorded daily and updated into a weekly sheet (Week 1, Week 2, Week 3.....Week 52, as available at the link below). The weekly sheets are all of the exact same layout. What I would like to do is have a macro to import selected variables from the weekly sheets into the individual load sheet, which is used as a longitudinal record of all the parameters.
The example "individual load" sheet I have included shows the longitudinal layout for the TD and HID parameters. So for example, the TD values from Monday in week 1 (D20:D53) need to be imported to I11:I44. The HID values in week 1 (E20:E53) need to be imported to I51:I84. Each subsequent parameter (SPR, HR, PL [DUR does not need to be imported]) would need to be imported into the correct day but underneath TD and HID.
Week 2 data for each parameter would need to be imported into the week 2 ranges in the individual load sheet (column P to V). The current import macro on the sheet requires that all data must be reimported each time data is updated. So for example, when wanting to add Week 35's data, all 35 weekly CSV files must be selected so that the values occupy the correct spaces. I don't have a problem with having to do this but if there was an option where only the CSV file of interest had to be imported that would be great.
Also of note, I may be changing the number of parameters from 6 to 8, so an easy to edit code would be great to allow me to make changes and accomodate extra parameters. Any help or advice would be hugely appreciated. I'm using Excel 2010.
Thanks
Richard
https://drive.google.com/folderview?id=0B62oOa7h0BprMDFhYjdQbFJRbUE&usp=sharing