Hi All,
I'm new to the forum and to the macro world. Here is what I'm trying to do:
I'm new to the forum and to the macro world. Here is what I'm trying to do:
- I have a datastream that consists of 23 datapoints/tag ID's that are logged on one minute intervals (see "Source Data")
- I would like to write a macro that select this data, sort it by date/time in ascending order, store numerical values as integers, copy the data, and transpose the data into a new workbook (see "Desired Format")
- I would like to be able to extract the source data into the new workbook without having to open the source data
Here are a few of the subtleties that are really throwing me for a loop:
- The range varies depending on when I download the source data
- Depending on when the source data is downloaded, the data tags/time stamps are not always the same
- I'm brand new to thisSource Data
<tbody>
[TD="align: center"]Var Name
[/TD]
[TD="align: center"]Time String
[/TD]
[TD="align: center"]Var Value
[/TD]
[TD="align: center"]16
[/TD]
[TD="align: center"]8/17/2017 16:48
[/TD]
[TD="align: center"]11.68718
[/TD]
[TD="align: center"]17
[/TD]
[TD="align: center"]8/17/2017 16:48
[/TD]
[TD="align: center"][/TD]
[TD="align: center"]18
[/TD]
[TD="align: center"]8/17/2017 16:48
[/TD]
[TD="align: center"]5.160007
[/TD]
[TD="align: center"]19
[/TD]
[TD="align: center"]8/17/2017 16:48
[/TD]
[TD="align: center"]35.0317
[/TD]
[TD="align: center"]20
[/TD]
[TD="align: center"]8/17/2017 16:48
[/TD]
[TD="align: center"]64.51823
[/TD]
[TD="align: center"]21
[/TD]
[TD="align: center"]8/17/2017 16:48
[/TD]
[TD="align: center"]8.507451
[/TD]
[TD="align: center"]22
[/TD]
[TD="align: center"]8/17/2017 16:48
[/TD]
[TD="align: center"]237.8111
[/TD]
[TD="align: center"]23
[/TD]
[TD="align: center"]8/17/2017 16:48
[/TD]
[TD="align: center"]11.01189
[/TD]
[TD="align: center"]1
[/TD]
[TD="align: center"]8/17/2017 16:49
[/TD]
[TD="align: center"]63.87153
[/TD]
[TD="align: center"]2
[/TD]
[TD="align: center"]8/17/2017 16:49
[/TD]
[TD="align: center"]224.6817
[/TD]
[TD="align: center"]3
[/TD]
[TD="align: center"]8/17/2017 16:49
[/TD]
[TD="align: center"]26.2641
[/TD]
[TD="align: center"]4
[/TD]
[TD="align: center"]8/17/2017 16:49
[/TD]
[TD="align: center"]21.99421
[/TD]
[TD="align: center"]5
[/TD]
[TD="align: center"]8/17/2017 16:49
[/TD]
[TD="align: center"]2.101758
[/TD]
[TD="align: center"]6
[/TD]
[TD="align: center"]8/17/2017 16:49
[/TD]
[TD="align: center"]450.557
[/TD]
[TD="align: center"]7
[/TD]
[TD="align: center"]8/17/2017 16:49
[/TD]
[TD="align: center"]63.24147
[/TD]
[TD="align: center"]8
[/TD]
[TD="align: center"]8/17/2017 16:49
[/TD]
[TD="align: center"]26.43088
[/TD]
[TD="align: center"]9
[/TD]
[TD="align: center"]8/17/2017 16:49
[/TD]
[TD="align: center"]14.90093
[/TD]
[TD="align: center"]10
[/TD]
[TD="align: center"]8/17/2017 16:49
[/TD]
[TD="align: center"]20.85473
[/TD]
[TD="align: center"]11
[/TD]
[TD="align: center"]8/17/2017 16:49
[/TD]
[TD="align: center"]27.56299
[/TD]
[TD="align: center"]12
[/TD]
[TD="align: center"]8/17/2017 16:49
[/TD]
[TD="align: center"]16.36641
[/TD]
[TD="align: center"]13
[/TD]
[TD="align: center"]8/17/2017 16:49
[/TD]
[TD="align: center"]67.8
[/TD]
[TD="align: center"]14
[/TD]
[TD="align: center"]8/17/2017 16:49
[/TD]
[TD="align: center"]256.2681
[/TD]
[TD="align: center"]15
[/TD]
[TD="align: center"]8/17/2017 16:49
[/TD]
[TD="align: center"]964.3976
[/TD]
[TD="align: center"]16
[/TD]
[TD="align: center"]8/17/2017 16:49
[/TD]
[TD="align: center"]11.794
[/TD]
[TD="align: center"]17
[/TD]
[TD="align: center"]8/17/2017 16:49
[/TD]
[TD="align: center"][/TD]
[TD="align: center"]18
[/TD]
[TD="align: center"]8/17/2017 16:49
[/TD]
[TD="align: center"]5.131602
[/TD]
[TD="align: center"]19
[/TD]
[TD="align: center"]8/17/2017 16:49
[/TD]
[TD="align: center"]34.98778
[/TD]
[TD="align: center"]20
[/TD]
[TD="align: center"]8/17/2017 16:49
[/TD]
[TD="align: center"]64.67014
[/TD]
[TD="align: center"]21
[/TD]
[TD="align: center"]8/17/2017 16:49
[/TD]
[TD="align: center"]8.528718
[/TD]
[TD="align: center"]22
[/TD]
[TD="align: center"]8/17/2017 16:49
[/TD]
[TD="align: center"]239.2578
[/TD]
[TD="align: center"]23
[/TD]
[TD="align: center"]8/17/2017 16:49
[/TD]
[TD="align: center"]11.62359
[/TD]
[TD="align: center"]1
[/TD]
[TD="align: center"]8/17/2017 16:50
[/TD]
[TD="align: center"]64.09722
[/TD]
[TD="align: center"]2
[/TD]
[TD="align: center"]8/17/2017 16:50
[/TD]
[TD="align: center"]226.7506
[/TD]
[TD="align: center"]3
[/TD]
[TD="align: center"]8/17/2017 16:50
[/TD]
[TD="align: center"]26.2424
[/TD]
[TD="align: center"]4
[/TD]
[TD="align: center"]8/17/2017 16:50
[/TD]
[TD="align: center"]21.98591
[/TD]
[TD="align: center"]5
[/TD]
[TD="align: center"]8/17/2017 16:50
[/TD]
[TD="align: center"]2.081016
[/TD]
[TD="align: center"]6
[/TD]
[TD="align: center"]8/17/2017 16:50
[/TD]
[TD="align: center"]451.0634
[/TD]
[TD="align: center"]7
[/TD]
[TD="align: center"]8/17/2017 16:50
[/TD]
[TD="align: center"]63.22338
[/TD]
[TD="align: center"]8
[/TD]
[TD="align: center"]8/17/2017 16:50
[/TD]
[TD="align: center"]26.42253
[/TD]
[TD="align: center"]9
[/TD]
[TD="align: center"]8/17/2017 16:50
[/TD]
[TD="align: center"]14.89425
[/TD]
[TD="align: center"]10
[/TD]
[TD="align: center"]8/17/2017 16:50
[/TD]
[TD="align: center"]20.86643
[/TD]
</tbody>
Desired Format[TABLE="class: MsoNormalTable, width: 472"]
<tbody>[TR]
[TD="width: 105, bgcolor: transparent"]Date/Time<o></o>
[/TD]
[TD="width: 21, bgcolor: transparent"]
[/TD]1<o></o>
[TD="width: 29, bgcolor: transparent"]
[/TD]2<o></o>
[TD="width: 21, bgcolor: transparent"]
[/TD]3<o></o>
[TD="width: 21, bgcolor: transparent"]
[/TD]4<o></o>
[TD="width: 15, bgcolor: transparent"]
[/TD]5<o></o>
[TD="width: 29, bgcolor: transparent"]
[/TD]6<o></o>
[TD="width: 21, bgcolor: transparent"]
[/TD]7<o></o>
[TD="width: 21, bgcolor: transparent"]
[/TD]8<o></o>
[TD="width: 21, bgcolor: transparent"]
[/TD]9<o></o>
[TD="width: 21, bgcolor: transparent"]
[/TD]10<o></o>
[TD="width: 21, bgcolor: transparent"]
[/TD]11<o></o>
[TD="width: 21, bgcolor: transparent"]
[/TD]12<o></o>
[TD="width: 21, bgcolor: transparent"]
[/TD]13<o></o>
[TD="width: 29, bgcolor: transparent"]
[/TD]14<o></o>
[TD="width: 29, bgcolor: transparent"]
[/TD]15<o></o>
[TD="width: 21, bgcolor: transparent"]
[/TD]16<o></o>
[TD="width: 21, bgcolor: transparent"]
[/TD]17<o></o>
[TD="width: 21, bgcolor: transparent"]
[/TD]18<o></o>
[TD="width: 21, bgcolor: transparent"]
[/TD]19<o></o>
[TD="width: 21, bgcolor: transparent"]
[/TD]20<o></o>
[TD="width: 21, bgcolor: transparent"]
[/TD]21<o></o>
[TD="width: 29, bgcolor: transparent"]
[/TD]22<o></o>
[TD="width: 21, bgcolor: transparent"]
[/TD]23<o></o>
[/TR]
[TR]
[TD="width: 105, bgcolor: transparent"]
[/TD]8/17/2017 16:48<o></o>
[TD="width: 21, bgcolor: transparent"] <o></o>
[/TD]
[TD="width: 29, bgcolor: transparent"] <o></o>
[/TD]
[TD="width: 21, bgcolor: transparent"] <o></o>
[/TD]
[TD="width: 21, bgcolor: transparent"] <o></o>
[/TD]
[TD="width: 15, bgcolor: transparent"] <o></o>
[/TD]
[TD="width: 29, bgcolor: transparent"] <o></o>
[/TD]
[TD="width: 21, bgcolor: transparent"] <o></o>
[/TD]
[TD="width: 21, bgcolor: transparent"] <o></o>
[/TD]
[TD="width: 21, bgcolor: transparent"] <o></o>
[/TD]
[TD="width: 21, bgcolor: transparent"] <o></o>
[/TD]
[TD="width: 21, bgcolor: transparent"] <o></o>
[/TD]
[TD="width: 21, bgcolor: transparent"] <o></o>
[/TD]
[TD="width: 21, bgcolor: transparent"] <o></o>
[/TD]
[TD="width: 29, bgcolor: transparent"] <o></o>
[/TD]
[TD="width: 29, bgcolor: transparent"] <o></o>
[/TD]
[TD="width: 21, bgcolor: transparent"]
[/TD]12<o></o>
[TD="width: 21, bgcolor: transparent"]
[/TD]0<o></o>
[TD="width: 21, bgcolor: transparent"]
[/TD]5<o></o>
[TD="width: 21, bgcolor: transparent"]
[/TD]35<o></o>
[TD="width: 21, bgcolor: transparent"]
[/TD]65<o></o>
[TD="width: 21, bgcolor: transparent"]
[/TD]9<o></o>
[TD="width: 29, bgcolor: transparent"]
[/TD]238<o></o>
[TD="width: 21, bgcolor: transparent"]
[/TD]11<o></o>
[/TR]
[TR]
[TD="width: 105, bgcolor: transparent"]
[/TD]8/17/2017 16:49<o></o>
[TD="width: 21, bgcolor: transparent"]
[/TD]64<o></o>
[TD="width: 29, bgcolor: transparent"]
[/TD]225<o></o>
[TD="width: 21, bgcolor: transparent"]
[/TD]26<o></o>
[TD="width: 21, bgcolor: transparent"]
[/TD]22<o></o>
[TD="width: 15, bgcolor: transparent"]
[/TD]2<o></o>
[TD="width: 29, bgcolor: transparent"]
[/TD]451<o></o>
[TD="width: 21, bgcolor: transparent"]
[/TD]63<o></o>
[TD="width: 21, bgcolor: transparent"]
[/TD]26<o></o>
[TD="width: 21, bgcolor: transparent"]
[/TD]15<o></o>
[TD="width: 21, bgcolor: transparent"]
[/TD]21<o></o>
[TD="width: 21, bgcolor: transparent"]
[/TD]28<o></o>
[TD="width: 21, bgcolor: transparent"]
[/TD]16<o></o>
[TD="width: 21, bgcolor: transparent"]
[/TD]68<o></o>
[TD="width: 29, bgcolor: transparent"]
[/TD]256<o></o>
[TD="width: 29, bgcolor: transparent"]
[/TD]964<o></o>
[TD="width: 21, bgcolor: transparent"]
[/TD]12<o></o>
[TD="width: 21, bgcolor: transparent"]
[/TD]0<o></o>
[TD="width: 21, bgcolor: transparent"]
[/TD]5<o></o>
[TD="width: 21, bgcolor: transparent"]
[/TD]35<o></o>
[TD="width: 21, bgcolor: transparent"]
[/TD]65<o></o>
[TD="width: 21, bgcolor: transparent"]
[/TD]9<o></o>
[TD="width: 29, bgcolor: transparent"]
[/TD]239<o></o>
[TD="width: 21, bgcolor: transparent"]
[/TD]12<o></o>
[/TR]
[TR]
[TD="width: 105, bgcolor: transparent"]
[/TD]8/17/2017 16:50<o></o>
[TD="width: 21, bgcolor: transparent"]
[/TD]64<o></o>
[TD="width: 29, bgcolor: transparent"]
[/TD]227<o></o>
[TD="width: 21, bgcolor: transparent"]
[/TD]26<o></o>
[TD="width: 21, bgcolor: transparent"]
[/TD]22<o></o>
[TD="width: 15, bgcolor: transparent"]
[/TD]2<o></o>
[TD="width: 29, bgcolor: transparent"]
[/TD]451<o></o>
[TD="width: 21, bgcolor: transparent"]
[/TD]63<o></o>
[TD="width: 21, bgcolor: transparent"]
[/TD]26<o></o>
[TD="width: 21, bgcolor: transparent"]
[/TD]15<o></o>
[TD="width: 21, bgcolor: transparent"]
[/TD]21<o></o>
[TD="width: 21, bgcolor: transparent"]
[/TD]28<o></o>
[TD="width: 21, bgcolor: transparent"]
[/TD]16<o></o>
[TD="width: 21, bgcolor: transparent"]
[/TD]68<o></o>
[TD="width: 29, bgcolor: transparent"]
[/TD]255<o></o>
[TD="width: 29, bgcolor: transparent"]
[/TD]966<o></o>
[TD="width: 21, bgcolor: transparent"]
[/TD]12<o></o>
[TD="width: 21, bgcolor: transparent"]
[/TD]0<o></o>
[TD="width: 21, bgcolor: transparent"]
[/TD]5<o></o>
[TD="width: 21, bgcolor: transparent"]
[/TD]35<o></o>
[TD="width: 21, bgcolor: transparent"]
[/TD]65<o></o>
[TD="width: 21, bgcolor: transparent"]
[/TD]9<o></o>
[TD="width: 29, bgcolor: transparent"]
[/TD]239<o></o>
[TD="width: 21, bgcolor: transparent"]
[/TD]11<o></o>
[/TR]
</tbody>[/TABLE]
I have tried muddling around on Youtube and the internet, but I have to admit that this is not my sweet spot (geologist by education). Is what I'd like to do possible with a macro? Any guidance would be greatly appreciated.
Cheers,
Keith
Cheers,
Keith