ljhansen
New member
- Joined
- Jul 21, 2020
- Messages
- 2
- Reaction score
- 0
- Points
- 0
- Excel Version(s)
- 2016
Hi,
On the first of each new month, I would like my workbook to automatically generate a new sheet for the new month and copy over rows that meet certain criteria in column J, that way I know the loan still needs attention from the previous month. I have been working with a code to generate the new sheet when the new month starts: it currently generates a new sheet from the Master sheet--which is fine for the first time as I don't have any June data to carry over, but I want it to generate from the previous month's sheet so that it copies over Unclosed loans from the previous month, and it currently brings over all of the rows (once you open the workbook it'll do it), no matter their Status. Here is the current code I have that I'm hoping to modify, but I can't seem to find a good starting place to begin:
I want it to only copy and paste those rows into the new sheet whose value in column J is not "Closed;" I have quite a few other options in column J that can be chosen from:
Received Application, Corresponding with Member, Awaiting Documentation, In Decision-Making, Submitted for Docs, Docs Sent to Member, Awaiting Closing, Awaiting Usage
The range where data can be input on the sheet is A4:K52, but the later rows may not end up having any data in them, so I would want it to loop and find the last row meeting the criteria
Is this possible? Any help is much appreciated!
On the first of each new month, I would like my workbook to automatically generate a new sheet for the new month and copy over rows that meet certain criteria in column J, that way I know the loan still needs attention from the previous month. I have been working with a code to generate the new sheet when the new month starts: it currently generates a new sheet from the Master sheet--which is fine for the first time as I don't have any June data to carry over, but I want it to generate from the previous month's sheet so that it copies over Unclosed loans from the previous month, and it currently brings over all of the rows (once you open the workbook it'll do it), no matter their Status. Here is the current code I have that I'm hoping to modify, but I can't seem to find a good starting place to begin:
Code:
Sub Next_Month()
Dim ws As Worksheet
Dim wsM As Worksheet
Dim strName As String
Dim bCheck As Boolean
On Error Resume Next
Set wsM = Sheets("Loans Template")
strName = Format(Date, "mm_yyyy")
bCheck = Len(Sheets(strName).Name) > 0
If bCheck = False Then
'add new sheet after Instructions
wsM.Copy After:=Sheets(1)
ActiveSheet.Name = strName
End If
Set wsM = Nothing
End Sub
I want it to only copy and paste those rows into the new sheet whose value in column J is not "Closed;" I have quite a few other options in column J that can be chosen from:
Received Application, Corresponding with Member, Awaiting Documentation, In Decision-Making, Submitted for Docs, Docs Sent to Member, Awaiting Closing, Awaiting Usage
The range where data can be input on the sheet is A4:K52, but the later rows may not end up having any data in them, so I would want it to loop and find the last row meeting the criteria
Is this possible? Any help is much appreciated!