Command Button to copy/paste rolling monthly date-based data from one worksheet to another

mbcmel

New Member
Joined
Jun 22, 2021
Messages
1
Office Version
  1. 365
Platform
  1. Windows
Hello! I am very new to Mr. Excel and VBA and I have spent quite a while trying to piece together other threads but I can't quite seem to figure it out. I apologize if this is actually answered elsewhere.

My data includes two worksheets within one workbook.
Sheet 1 is Master Monthly Data: over 20 rows, where one row (representing a new month) is added to the last row. Every row has 15 columns of data.
Sheet 2 is Annual Rolling Data: contains only 12 rows (12 months) and is updated as 12-month rolling, with the same 15 columns of data as Sheet 1.
My goal is to use a Command Button on Sheet 2 to populate Sheet 2 with Sheet 1 data based on matching dates.

I can attempt to explain it but I do not have enough of a successful attempt at my own code to post, please see the attached image of Sheet 1 and Sheet 2.
If Sheet 2 cells(date) Range B18:B29 match Sheet 1 cells(date) Range A12:A43 then copy the next 15 cells for each row (will be a total of 12 rows), and paste to Sheet 2 cells Range C18:Q29.

Thank you in advance!!!
 

Attachments

  • SHEET 1_MASTER MONTHLY DATA.png
    SHEET 1_MASTER MONTHLY DATA.png
    53.4 KB · Views: 20
  • SHEET 2_ANNUAL ROLLING DATA.png
    SHEET 2_ANNUAL ROLLING DATA.png
    15 KB · Views: 18

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)

Forum statistics

Threads
1,147,632
Messages
5,742,229
Members
423,714
Latest member
ftp2jz

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
Top