Use one master worksheet to sort into dated worksheets

Thebeatbandit

New Member
Joined
Dec 22, 2020
Messages
4
Office Version
  1. 2016
Platform
  1. Windows
I’ve tried to find this answer because I’m sure the question has been asked before.

I have a roster of people that have dates associated with them. I would like to have a master list so I could see the whole roster and have them automatically populated into worksheets titled by their month. I want the entire row to be populated in the monthly worksheets. The date is part of the data in the master roster.

Any suggestions?

Thanks in advance.
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
You said:
I have a roster of people that have dates associated with them.

Where on the sheets are these dates?

Are these dates in column A or Column B or what column?
Do not say column Dates.

And you said:
I would like to have a master list so I could see the whole roster and have them automatically populated into worksheets titled by their month.

Automatically is not something Excel can normally do.
It will take some action on your part.
Like when you enter a date in column G of the active sheet which is your master sheet this row could be copied to another sheet.

Like if you enter 12/07/2020 into column G of the Master sheet this row could be copied to a sheet named December.

But to make sure things work perfectly I would suggest you enter the date in the cell then double click on that cell when your ready and this row would then be copied to the proper sheet.

But then we would have to know exactly how your sheets are named.

Like are they named like January February March
Or is it like Jan Feb Mar

Please give specific details. Like what is the named of the Master sheet.
And to let you know sheets cannot be named:
1/1/2020 for example
They can be named January February March
 
Upvote 0
The first worksheet that I need to reference is titled "Roster". The date that needs to be reference is located in the L column starting with L3 continuing downwards. The other worksheets are titled "January", "February", etc. The information needed to be copied based on what month the date is in (the date is written as a specific date, "1/1/2020") is contained in the row from A-AE.
 
Upvote 0
The first worksheet that I need to reference is titled "Roster". The date that needs to be reference is located in the L column starting with L3 continuing downwards. The other worksheets are titled "January", "February", etc. The information needed to be copied based on what month the date is in (the date is written as a specific date, "1/1/2020") is contained in the row from A-AE.
So are you wanting the script to look down column L of sheet named Roster and copy all the rows at one time to the proper sheet when you click a button? Or do you want the script to run when you do something else. And you said A-AE. Can we not copy the entire row. Or is there a reason why we do not want to copy the entire row.
 
Upvote 0
Definitely can copy the whole row.
It can copy based on a button press, pull based on a formula in the other sheets, or whatever would work best. I just need the rows to be separated into different sheets based on their month
 
Upvote 0
Try this:
Put this script in a button on sheet named Roster
VBA Code:
Sub Copy_Rows_By_Month()
'Modified  12/22/2020  11:20:37 PM  EST
Application.ScreenUpdating = False
On Error GoTo M
Dim i As Long
Dim Lastrow As Long
Dim Lastrowa As Long
Sheets("Roster").Activate
Lastrow = Sheets("Roster").Cells(Rows.Count, "L").End(xlUp).Row
Dim ans As String
For i = 3 To Lastrow
    ans = Format(Cells(i, "L").Value, "MMMM")
    Lastrowa = Sheets(ans).Cells(Rows.Count, "A").End(xlUp).Row + 1
    Rows(i).Copy Sheets(ans).Cells(Lastrowa, 1)
Next
Application.ScreenUpdating = True
Exit Sub
M:
MsgBox "We had a problem you may not have a sheet by that name" & vbNewLine & ans & " Is not a sheet in this Workbook"
'MsgBox ans & "is not a sheet in this Workbook"
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,908
Messages
6,122,187
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