Copy and paste VBA code including duplicate values

Indominus

Board Regular
Joined
Jul 11, 2020
Messages
160
Office Version
  1. 2016
Platform
  1. Windows
Hi. So I have two workbooks here. I have attached screenshots of both. One is Pickorder. Column A lists the dispatch times. Column B has route codes. Column D has the dispatch areas. Column E has the dsp taking the route. For example, CX19 dispatches at 6:15:00, at STG.A01 for HIQL. I then have this Wave planner sheet. The goal is to copy and paste the route codes (column B) from Pickorder into the correct time column on the Wave Planner matching both the staging location and dsp. However, the Pickorder I receive daily has duplicate staging areas at different times. For example route codes that dispatch at 8:15:00 have dispatch area A also and start at STG.A01. 8:45 dispatch route codes are at dispatch area B. Attached is an image of how the wave planner should look like after the route codes are copied and pasted in this example. How could this be done to match the criteria's of the dispatch time along with the staging area and dsp? I am fairly new to VBA and can not find much information online when it comes to codes with duplicate values. Thank you to anyone willing to help me.
 

Attachments

  • Auto Pickorder image.JPG
    Auto Pickorder image.JPG
    176.1 KB · Views: 10
  • PasteWavePlan image.JPG
    PasteWavePlan image.JPG
    192.1 KB · Views: 11
  • Final Wave Plan image.JPG
    Final Wave Plan image.JPG
    236.6 KB · Views: 11

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.

Forum statistics

Threads
1,214,908
Messages
6,122,186
Members
449,071
Latest member
cdnMech

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