VBA generates word docs, request to amend code to include description of deadlines/tasks due

ttp921

New Member
Joined
Sep 8, 2023
Messages
7
Office Version
  1. 365
Platform
  1. Windows
My VBA macro runs reports from Excel to generate a Word doc with upcoming deadlines/due dates. However, I can't figure out how to get the report to automatically sort the deadlines in chronological order when I run macros. Currently, the report generates deadlines like this:

JONES, LESLIE (CASE DATE 12-8-2021) - SOL EXP. DATE - 12/8/2023 - CLT CONTACT DUE - 11/1/2023 - TASK DUE - 11/21/2023 - TASK DUE DESCRIPTION – COLLECT ADD’L ONBOARDING DOCUMENTS FROM THE CLIENT
DOE, JOHN (CASE DATE) 12-9-2021 - SOL EXP. DATE - 12/9/2023 - CLT CONTACT DUE - 11/21/2023 - TASK DUE - 11/11/2023 - TASK DUE DESCRIPTION – FILL OUT PAPERWORK TO SEND TO THE CLIENT THAT’S DUE IN JANUARY 2024

Here are the columns that I am most concerned about:
COLUMN J = CLT CONTACT DUE
COLUMN M = TASK DUE
COLUMN N = TASK DUE DESCRIPTION

I'd like the report to prioritize sorting COLUMN M (Task Due Date) with COLUMN N (Task Due Description), then sort COLUMN J (CLT CONTACT DUE). Ideally, I would love to keep both of the due dates (task due and clt contact due) and task description together in a single line, like this:

JONES, LESLIE (CASE DATE 12-8-2021) - SOL EXP. DATE - 12/8/2023 – TASK DUE - 11/21/2023 - TASK DUE DESCRIPTION – COLLECT ADD’L ONBOARDNING DOCUMENTS FROM THE CLIENT - CLT CONTACT DUE - 11/1/2023
DOE, JOHN (CASE DATE) 12-9-2021 - SOL EXP. DATE - 12/9/2023 – TASK DUE - 11/11/2023 - TASK DUE DESCRIPTION – FILL OUT PAPERWORK TO SEND TO THE CLIENT THAT’S DUE IN JANUARY 2024 - CLT CONTACT DUE - 11/21/2023

However, if it makes more sense to make separate sections by splitting up Column J from Columns M,N, then that's okay too.

Please help!


CASE DEADLINES EXCEL.xlsm
ABCDEFGHIJKLMN
1MATTER NAMEINCIDENT DATE+/- YRSSOL EXP. DATEDISPOSED DATENEW SOL EXP. DATESUB-STATUSLAST CONTACT DATE+/- DAYSCLT CONTACT DUETASK DATE+/- DAYSTASK DUETASK DUE DESCRIPTION
2JONES, LESLIE (CASE DATE 12-8-2021) 12/8/2021212/8/202310/27/202110/27/2023INTAKE10/2/20233011/1/202310/25/20232711/21/2023COLLECT ADD’L ONBOARDING DOCUMENTS FROM THE CLIENT
3DOE, JOHN (CASE DATE) 12-9-2021 12/9/2021212/9/2023N/AN/AINTAKE10/22/20233011/21/202310/15/20232711/11/2023FILL OUT PAPERWORK TO SEND TO THE CLIENT THAT’S DUE IN JANUARY 2024
4SMITH, CHRIS 05-15-202105/15/202125/15/20233/30/20223/30/2024CLOSE FILE 9/27/20233010/27/20238/24/2023309/23/2023CALL CLIENT TO CLOSE FILE
Sheet 1
Cell Formulas
RangeFormula
F2,F4F2=DATE(YEAR(E2)+C2,MONTH(E2),DAY(E2))
D2:D4D2=DATE(YEAR(B2)+C2,MONTH(B2),DAY(B2))
J2:J4,M2:M4J2=H2+I2
Cells with Conditional Formatting
CellConditionCell FormatStop If True
M:MCell Value<TODAY()textNO
M:MCell Value=TODAY()textNO
M:MCell Valuebetween TODAY() and TODAY()+5textNO
M:MCell Value>TODAY()textNO
D:DCell Value<TODAY()textNO
J:JCell Value<TODAY()textNO
J:JCell Value=TODAY()textNO
D:DCell Value=TODAY()textNO
D:DCell Valuebetween TODAY() and TODAY()+30textNO
J:JCell Valuebetween TODAY() and TODAY()+30textNO
D:DCell Valuebetween TODAY() and TODAY()+90textNO
D:DCell Valuebetween TODAY() and TODAY()+180textNO
D:DCell Value>TODAY()textNO
J:JCell Valuebetween TODAY() and TODAY()+90textNO
J:JCell Valuebetween TODAY() and TODAY()+180textNO
J:JCell Value>=TODAY()+1textNO
 
Last edited by a moderator:

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December

Forum statistics

Threads
1,215,069
Messages
6,122,959
Members
449,096
Latest member
Anshu121

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