VBA to copy duplicated data to a different column

cajunman64

New Member
Joined
Sep 20, 2018
Messages
1
I am looking to create a vba in excel that will look at Column B and E and copy the next duplicate data to the next column and than repeat the program until all duplicate data been copy. Note we have a trending software that will export data to a .csv file....it adds all the sensors data to column C (xxxx.xx),it adds all the sensors name to column B (DHPT-PT1.ActiveReadValue), it adds all the Dates to column D and all the time to column E.

Example:
A B c D E
Trend File Tag Name Tag Value Tag Timestamp (Date) Tag Timestamp (Time)
Test1.tvwDHPT-PT1.ActiveReadValue9189.4531259/19/1829:59.6
Test1.tvwDHPT-PT1.ActiveReadValue9190.8007819/19/1830:59.4
Test1.tvwDHPT-PT1.ActiveReadValue9193.1425789/19/1831:59.5
Test1.tvwDHPT-PT1.ActiveReadValue9191.1093759/19/1832:59.6
Test1.tvwDHPT-PT1.ActiveReadValue9192.2802739/19/1833:59.7

<colgroup><col><col><col><col><col></colgroup><tbody>
</tbody>
Test1.tvwDHPT-PT2.ActiveReadValue8353.4609389/19/1829:59.6
Test1.tvwDHPT-PT2.ActiveReadValue8355.1679699/19/1830:59.4
Test1.tvwDHPT-PT2.ActiveReadValue8357.4492199/19/1831:59.5
Test1.tvwDHPT-PT2.ActiveReadValue8358.403329/19/1832:59.6
Test1.tvwDHPT-PT2.ActiveReadValue8356.1884779/19/1833:59.7

<colgroup><col><col><col><col><col></colgroup><tbody>
</tbody>
Test1.tvwDHPT-PT3.ActiveReadValue9187.7324229/19/1829:59.6
Test1.tvwDHPT-PT3.ActiveReadValue9189.1230479/19/1830:59.4
Test1.tvwDHPT-PT3.ActiveReadValue9191.4453139/19/1831:59.5
Test1.tvwDHPT-PT3.ActiveReadValue9189.4335949/19/1832:59.6
Test1.tvwDHPT-PT3.ActiveReadValue9190.5605479/19/1833:59.7

<colgroup><col><col><col><col><col></colgroup><tbody>
</tbody>

Looking to copy DHPT-PT1 data with date and time to a new workbook or the same csv file but to a different sheet in column A2 starting Date, B2 Starting Time, Column C2 Starting DHPT1 Values, Column D2 starting DHPT2 Values, and E2 starting DHPT3 values

Column A Column B Column C Column D Column E

1) Date Time DHPT-PT1 DHPT-PT2 DHPT-PT3
2) 9/19/18 29:59.6 9189.453125 8353.460938 9187.732422
3) 9/19/18 30:59.4 9190.800781 8355.167969 9189.123047
4) 9/19/18 31:59.5 9193.142578 8357.449219 9191.445313
5) 9/19/18 32:59.6 9191.109375 8358.40332 9189.433594
6) 9/19/18 33:59.7 9192.280273 8356.188477 9190.560547

Thanks for the help
 

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,214,591
Messages
6,120,425
Members
448,961
Latest member
nzskater

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