abberyfarm
Well-known Member
- Joined
- Aug 14, 2011
- Messages
- 733
Hi,
I am hoping somebody here could help me out with a macro to do a task that I have
In sheet 1, I have time values (Col A) and speed values (Col B).
In sheet 2, I have a start time (Col A), an end time (Col B) and in column C either numbers 1 and 2 which indicate a particular type of data.
Here is an example of sheet 1
And of sheet 2
What I need to do is, for all the type 1s in sheet 2, take the start and end time and go to sheet 1. Then find all the speed values between the start time and end time, copy them to a new sheet and save that sheet to a folder. Then delete the new sheet. Then get the next start and end time from sheet 2 and do the process again.
The idea is that I would have a folder with each file containing the speed values between a start and end time.
Thank you in advance for any help. If any part is unclear please message me and I'll get back asap.
Thanks
I am hoping somebody here could help me out with a macro to do a task that I have
In sheet 1, I have time values (Col A) and speed values (Col B).
In sheet 2, I have a start time (Col A), an end time (Col B) and in column C either numbers 1 and 2 which indicate a particular type of data.
Here is an example of sheet 1
Code:
Time [sec] Speed
14/04/2011 07:40:35 0
14/04/2011 07:40:36 1
14/04/2011 07:40:37 3
14/04/2011 07:40:38 4
14/04/2011 07:40:39 5
14/04/2011 07:40:40 7
14/04/2011 07:40:41 8
14/04/2011 07:40:42 9
14/04/2011 07:40:43 10
14/04/2011 07:40:44 10
14/04/2011 07:40:45 11
14/04/2011 07:40:46 12
14/04/2011 07:40:47 12
14/04/2011 07:40:48 13
14/04/2011 07:40:49 14
14/04/2011 07:40:50 15
14/04/2011 07:40:51 3.8
14/04/2011 07:40:52 7.5
14/04/2011 07:40:53 11.2
14/04/2011 07:40:54 15
14/04/2011 07:40:55 15
14/04/2011 07:40:56 15
14/04/2011 07:40:57 15
14/04/2011 07:40:58 15
14/04/2011 07:40:59 15
14/04/2011 07:41:00 15
14/04/2011 07:41:01 15
14/04/2011 07:41:02 15
And of sheet 2
Code:
Start Time [sec] End Time [sec] Type
14/04/2011 07:40:35 14/04/2011 07:41:05 1
14/04/2011 07:41:06 14/04/2011 07:41:36 1
14/04/2011 07:41:37 14/04/2011 07:42:07 2
14/04/2011 07:42:08 14/04/2011 07:42:38 1
14/04/2011 07:42:39 14/04/2011 07:43:09 2
14/04/2011 07:43:10 14/04/2011 07:43:40 2
14/04/2011 07:43:41 14/04/2011 07:44:11 2
14/04/2011 07:44:12 14/04/2011 07:44:42 2
14/04/2011 07:44:43 14/04/2011 07:45:13 1
14/04/2011 07:45:14 14/04/2011 07:45:44 1
14/04/2011 07:45:45 14/04/2011 07:46:15 2
14/04/2011 07:46:16 14/04/2011 07:46:46 1
14/04/2011 07:46:47 14/04/2011 07:47:17 2
14/04/2011 07:47:18 14/04/2011 07:47:48 2
14/04/2011 07:47:49 14/04/2011 07:48:19 1
14/04/2011 07:48:20 14/04/2011 07:48:50 1
14/04/2011 07:48:51 14/04/2011 07:49:21 1
14/04/2011 07:49:22 14/04/2011 07:49:52 2
14/04/2011 07:49:53 14/04/2011 07:50:23 2
14/04/2011 07:50:24 14/04/2011 07:50:54 1
14/04/2011 07:50:55 14/04/2011 07:51:25 1
14/04/2011 07:51:26 14/04/2011 07:51:56 1
14/04/2011 07:51:57 14/04/2011 07:52:27 1
14/04/2011 07:52:28 14/04/2011 07:52:58 2
14/04/2011 07:52:59 14/04/2011 07:53:29 1
14/04/2011 07:53:30 14/04/2011 07:54:00 2
What I need to do is, for all the type 1s in sheet 2, take the start and end time and go to sheet 1. Then find all the speed values between the start time and end time, copy them to a new sheet and save that sheet to a folder. Then delete the new sheet. Then get the next start and end time from sheet 2 and do the process again.
The idea is that I would have a folder with each file containing the speed values between a start and end time.
Thank you in advance for any help. If any part is unclear please message me and I'll get back asap.
Thanks