Copy All Data For A Given Month Onto Another Sheet

kelly mort

Well-known Member
Joined
Apr 10, 2017
Messages
2,169
Office Version
  1. 2016
Platform
  1. Windows
Looking at the sheet below :
New_data_layout.jpg


I want to copy all the data for January to a different sheet.
Let us say the sheet containing the data is Sheet1 and I want the result on Sheet2.

The month selection will come from a combobox selection where the months appear in the combobox as:
JAN
FEB
MAR
APR
MAY
JUN
etc.
So when I select say JAN from the combobox, then I want to copy all the data for JAN onto Sheet2.
And when I select FEB for example too, I want to copy all records for FEB onto Sheet2
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
For computers, this a terrible way to store data. Tho it looks good for humans, data analysis (or transfer) is not possible in this layout.
At least, not without a lot of programming.

Now if all data in the worksheet only contains the 1 month, then you can just copy the tab.
 
Upvote 0
For computers, this a terrible way to store data. Tho it looks good for humans, data analysis (or transfer) is not possible in this layout.
At least, not without a lot of programming.

Now if all data in the worksheet only contains the 1 month, then you can just copy the tab.
Okay thanks for the heads up.

Then I have to alter my layout and come again.
 
Upvote 0
Hello @ranman256,

After several considerations, I decided to maintain my data layout but added a helping column which I think could help get what I want to achieve.

Altering the layout could give me more headaches than what I am facing at the moment.

From the image below, I want to achieve any of the filtered data at the right depending on which month I reference.
NEW_IMAGE.jpg


I am thinking of copying all data for 1s under the column C (month)
Then I delete all date rows (from col A) from the copied data.
After that, I will also delete all DAILY TOTALS rows (Under col A) from the copied data.

Once I am done with the above deletions, my copied data should contain just the items or products.
My next move would be to remove duplicates so that no item appears more than once in the copied data.

From here, using a sumif function against the range the data was copied from used get me result.

But my issue here is that I don't know how to start writing the script to point me to the right direction.

Can someone please help me out?

Ps: I want the output to be on a different sheet.

Thanks in advance.
 
Upvote 0

Forum statistics

Threads
1,214,911
Messages
6,122,198
Members
449,072
Latest member
DW Draft

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