VBA Excel Find Values based on location and date in one workbook and paste to corresponding date in another workbook

cjjj95

New Member
Joined
Aug 11, 2021
Messages
1
Office Version
  1. 2019
Platform
  1. Windows
I'm relatively new to VBA and am struggling with writing a code that requires searching a Masterwork sheet for location and date, and then pasting that to the corresponding date in a separate dedicated workbook. Due to the nature of my employer, I can't actually show the values but I'll try my best to upload a similar idea. We have several "objects" that are not measured at a regular time interval. They are measured when we can actually spare time to physically measure them so the dates intervals can be quite random. The each object will have its own dedicated workbook based on location. I was wondering if you could me out with a code that reads the location and date and pastes that into the corresponding workbook in the corresponding row with the same date. Furthermore, since we don't take measurements every single day, we assume the next days measurements to be the same as the day before unless a measurement has been taken that day. I will upload an example.

The example here regards the object in NW. the measurements are taken on the 1/7, 4/7, and 10/7 and these are recorded in the MasterWorkBook. There is a dedicated workbook for NW (NWWorkbook) where the height and length will need to be pasted to the corresponding rows. The height and length are assumed to remain the same until the next measurement. The NWWorkbook is what the destination file should look like with a working code (cells highlighted in green just to show that they are measure values and doesn't need to do this in the actual code). I'd like for the masterworkbook to contain the code if possible



I have tried searching for about a week now but there is nothing online that tells me how to search for something with two criteria and then paste the row into a different workbook in the row with corresponding date. Your help would be much appreciated!
 

Attachments

  • master.png
    master.png
    26.2 KB · Views: 15
  • nwworkbook.png
    nwworkbook.png
    9 KB · Views: 15

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.

Forum statistics

Threads
1,223,262
Messages
6,171,080
Members
452,377
Latest member
bradfordsam

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