Hi there, this is a complex problem for me to figure out so I ask for help.
I have two departments, "Department 70" and "Department 75". These departments have thousands of rows with data. I need to create a macro that will check for duplicates in certain columns in a row of each Department and if duplicates excite then delete the matching row from Department 70.
The conditions: For comparing data I can only use the Names, Dates and Dollar Values which is in columns labeled 0-30 Days, 31-60 Days..etc.
If some rows are deleted from Department 70 then the account totals will need to be adjusted. That I believe I can figure it out, just stating that out there for your information.
-----------------------------------------------------------------------------
In "Department 70", I can only use ColumnB:H
Department 70 sample
------------------------------------------------------------------------------
[TABLE="width: 986"]
<tbody>[TR]
[TD="colspan: 2"]Department 70 Residence[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="colspan: 2"]ACCOUNT#: 1-026-70-00000-3405[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]MEMBER NUMBER[/TD]
[TD]MEMBER NAME[/TD]
[TD]TRN DATE[/TD]
[TD]0 -30 DAYS[/TD]
[TD]31-60 DAYS[/TD]
[TD]61-90 DAYS[/TD]
[TD]OVER 90 DAYS[/TD]
[TD]PAST DUE[/TD]
[/TR]
[TR]
[TD]026-500000031-00[/TD]
[TD]Holmes, Ollie[/TD]
[TD="align: right"]7/6/2016[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$606.60[/TD]
[TD="align: right"]$606.60[/TD]
[/TR]
[TR]
[TD]026-500000031-00[/TD]
[TD]Holmes, Ollie[/TD]
[TD="align: right"]7/6/2016[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$325.02[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$325.02[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]ACCOUNT TOTAL[/TD]
[TD][/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$325.02[/TD]
[TD="align: right"]$606.60[/TD]
[TD="align: right"]$931.62[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="colspan: 2"]ACCOUNT#: 1-026-70-00000-3411[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]MEMBER NUMBER[/TD]
[TD]MEMBER NAME[/TD]
[TD]TRN DATE[/TD]
[TD]0-30 DAYS[/TD]
[TD]31-60 DAYS[/TD]
[TD]61-90 DAYS[/TD]
[TD]OVER 90 DAYS[/TD]
[TD]PAST DUE[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]026-500184014-00[/TD]
[TD]Zhao, Ting[/TD]
[TD="align: right"]2/1/2015[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$507.96[/TD]
[TD="align: right"]$507.96[/TD]
[/TR]
[TR]
[TD]026-500184014-00[/TD]
[TD]Zhao, Ting[/TD]
[TD="align: right"]3/2/2015[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$507.96[/TD]
[TD="align: right"]$507.96[/TD]
[/TR]
[TR]
[TD]026-500184014-00[/TD]
[TD]Zhao, Ting[/TD]
[TD="align: right"]3/2/2015[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$507.96[/TD]
[TD="align: right"]$507.96[/TD]
[/TR]
[TR]
[TD]026-500184014-00[/TD]
[TD]Zhao, Ting[/TD]
[TD="align: right"]3/2/2015[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$507.96[/TD]
[TD="align: right"]$507.96[/TD]
[/TR]
[TR]
[TD]026-500184014-00[/TD]
[TD]Zhao, Ting[/TD]
[TD="align: right"]3/2/2015[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$507.96[/TD]
[TD="align: right"]$507.96[/TD]
[/TR]
[TR]
[TD]026-500184014-00[/TD]
[TD]Zhao, Ting[/TD]
[TD="align: right"]3/2/2015[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$507.96[/TD]
[TD="align: right"]$507.96[/TD]
[/TR]
[TR]
[TD]026-500184014-00[/TD]
[TD]Zhao, Ting[/TD]
[TD="align: right"]3/2/2015[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$507.96[/TD]
[TD="align: right"]$507.96[/TD]
[/TR]
[TR]
[TD]026-500184014-00[/TD]
[TD]Zhao, Ting[/TD]
[TD="align: right"]3/2/2015[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$507.96[/TD]
[TD="align: right"]$507.96[/TD]
[/TR]
[TR]
[TD]026-500184014-00[/TD]
[TD]Zhao, Ting[/TD]
[TD="align: right"]3/2/2015[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$507.96[/TD]
[TD="align: right"]$507.96[/TD]
[/TR]
[TR]
[TD]026-500184014-00[/TD]
[TD]Zhao, Ting[/TD]
[TD="align: right"]3/2/2015[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$507.96[/TD]
[TD="align: right"]$507.96[/TD]
[/TR]
[TR]
[TD]026-500184014-00[/TD]
[TD]Zhao, Ting[/TD]
[TD="align: right"]5/30/2015[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$507.96[/TD]
[TD="align: right"]$507.96[/TD]
[/TR]
[TR]
[TD]026-500184014-00[/TD]
[TD]Zhao, Ting[/TD]
[TD="align: right"]5/30/2015[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$507.96[/TD]
[TD="align: right"]$507.96[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]ACCOUNT TOTAL[/TD]
[TD][/TD]
[TD="align: right"]$2,006.18[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$19,881.00[/TD]
[TD="align: right"]$21,887.18[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD]GRAND TOTAL[/TD]
[TD="align: right"]$28,814.20[/TD]
[TD="align: right"]$9,144.17[/TD]
[TD="align: right"]$945.34[/TD]
[TD="align: right"]$43,694.18[/TD]
[TD="align: right"]$82,597.89[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
-----------------------------------------------------------------------------
In "Department 75", I can only use ColumnA, ColumnC:H but
ColumnC has two dates shown in the chart below, so I can only use the left 10 strings to match the date with department 70.
Department 75 sample
------------------------------------------------------------------------------
[TABLE="width: 986"]
<tbody>[TR]
[TD="colspan: 3"]Department 75 Club Service,General[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="colspan: 2"]ACCOUNT#: 1-026-75-00000-3414[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]MEMBER NUMBER[/TD]
[TD]MEMBER ROOM[/TD]
[TD]TRN DATE[/TD]
[TD]0 -30 DAYS[/TD]
[TD]31-60 DAYS[/TD]
[TD]61-90 DAYS[/TD]
[TD]OVER 90 DAYS[/TD]
[TD]PAST DUE[/TD]
[/TR]
[TR]
[TD]Brewer, Elliot[/TD]
[TD]842[/TD]
[TD]04/01/2017 05/01/2017[/TD]
[TD="align: right"]$234.17[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$234.17[/TD]
[/TR]
[TR]
[TD]Byrd, Malcolm (Patrick)[/TD]
[TD]874W[/TD]
[TD]04/01/2017 05/01/2017[/TD]
[TD="align: right"]$182.88[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$182.88[/TD]
[/TR]
[TR]
[TD]Dennis, Samuel[/TD]
[TD]878W[/TD]
[TD]03/01/2017 04/01/2017[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$541.18[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$541.18[/TD]
[/TR]
[TR]
[TD]Dennis, Samuel[/TD]
[TD]878W[/TD]
[TD]04/01/2017 05/01/2017[/TD]
[TD="align: right"]$198.43[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$198.43[/TD]
[/TR]
[TR]
[TD]Doskocz, Eliza[/TD]
[TD]656W[/TD]
[TD]04/01/2017 05/01/2017[/TD]
[TD="align: right"]$210.96[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$210.96[/TD]
[/TR]
[TR]
[TD]Foster, Eustacia[/TD]
[TD]762W[/TD]
[TD]01/14/2015 02/14/2015[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$34.64[/TD]
[TD="align: right"]$34.64[/TD]
[/TR]
[TR]
[TD]Foster, Eustacia[/TD]
[TD]762W[/TD]
[TD]03/14/2015 04/14/2015[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$584.64[/TD]
[TD="align: right"]$584.64[/TD]
[/TR]
[TR]
[TD]Foster, Eustacia[/TD]
[TD]762W[/TD]
[TD]04/14/2015 05/14/2015[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$584.64[/TD]
[TD="align: right"]$584.64[/TD]
[/TR]
[TR]
[TD]Foster, Eustacia[/TD]
[TD]762W[/TD]
[TD]05/14/2015 06/14/2015[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$584.64[/TD]
[TD="align: right"]$584.64[/TD]
[/TR]
[TR]
[TD]Foster, Eustacia[/TD]
[TD]762W[/TD]
[TD]02/14/2016 03/14/2016[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$584.64[/TD]
[TD="align: right"]$584.64[/TD]
[/TR]
[TR]
[TD]Foster, Eustacia[/TD]
[TD]762W[/TD]
[TD]06/14/2015 07/14/2015[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$584.64[/TD]
[TD="align: right"]$584.64[/TD]
[/TR]
[TR]
[TD]Zhao, Ting[/TD]
[TD]657W[/TD]
[TD]01/01/2016 02/01/2016[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$507.96[/TD]
[TD="align: right"]$507.96[/TD]
[/TR]
[TR]
[TD]Zhao, Ting[/TD]
[TD]657W[/TD]
[TD]05/01/2016 06/01/2016[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$507.96[/TD]
[TD="align: right"]$507.96[/TD]
[/TR]
[TR]
[TD]Zhao, Ting[/TD]
[TD]657W[/TD]
[TD]02/01/2016 03/01/2016[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$507.96[/TD]
[TD="align: right"]$507.96[/TD]
[/TR]
[TR]
[TD]Zhao, Ting[/TD]
[TD]657W[/TD]
[TD]03/01/2016 04/01/2016[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$507.96[/TD]
[TD="align: right"]$507.96[/TD]
[/TR]
[TR]
[TD]Zhao, Ting[/TD]
[TD]657W[/TD]
[TD]04/01/2016 05/01/2016[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$507.96[/TD]
[TD="align: right"]$507.96[/TD]
[/TR]
[TR]
[TD]Zhao, Ting[/TD]
[TD]657W[/TD]
[TD]06/01/2016 07/01/2016[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$507.96[/TD]
[TD="align: right"]$507.96[/TD]
[/TR]
[TR]
[TD]Zhao, Ting[/TD]
[TD]657W[/TD]
[TD]07/01/2016 08/01/2016[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$507.96[/TD]
[TD="align: right"]$507.96[/TD]
[/TR]
[TR]
[TD]Zhao, Ting[/TD]
[TD]657W[/TD]
[TD]08/01/2016 09/01/2016[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$507.96[/TD]
[TD="align: right"]$507.96[/TD]
[/TR]
[TR]
[TD]Zhao, Ting[/TD]
[TD]657W[/TD]
[TD]09/01/2016 10/01/2016[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$507.96[/TD]
[TD="align: right"]$507.96[/TD]
[/TR]
[TR]
[TD]Zhao, Ting[/TD]
[TD]657W[/TD]
[TD]10/01/2016 11/01/2016[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$507.96[/TD]
[TD="align: right"]$507.96[/TD]
[/TR]
[TR]
[TD]Zhao, Ting[/TD]
[TD]657W[/TD]
[TD]11/01/2016 12/01/2016[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$507.96[/TD]
[TD="align: right"]$507.96[/TD]
[/TR]
[TR]
[TD]Zhao, Ting[/TD]
[TD]657W[/TD]
[TD]12/01/2016 01/01/2017[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$507.96[/TD]
[TD="align: right"]$507.96[/TD]
[/TR]
[TR]
[TD]Zhao, Ting[/TD]
[TD]657W[/TD]
[TD]01/01/2017 02/01/2017[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$507.96[/TD]
[TD="align: right"]$507.96[/TD]
[/TR]
[TR]
[TD]Zhao, Ting[/TD]
[TD]657W[/TD]
[TD]02/01/2017 03/01/2017[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$507.96[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$507.96[/TD]
[/TR]
[TR]
[TD]Zhao, Ting[/TD]
[TD]657W[/TD]
[TD]03/01/2017 04/01/2017[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$507.96[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$507.96[/TD]
[/TR]
[TR]
[TD]Zhao, Ting[/TD]
[TD]657W[/TD]
[TD]04/01/2017 05/01/2017[/TD]
[TD="align: right"]$186.25[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$186.25[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]ACCOUNT TOTAL[/TD]
[TD][/TD]
[TD="align: right"]$4,640.67[/TD]
[TD="align: right"]$5,335.48[/TD]
[TD="align: right"]$4,598.10[/TD]
[TD="align: right"]$61,208.45[/TD]
[TD="align: right"]$75,782.70[/TD]
[/TR]
</tbody>[/TABLE]
The code I have created so far but it doesn't work.
If you have questions please ask away.
Thank you in advance
I have two departments, "Department 70" and "Department 75". These departments have thousands of rows with data. I need to create a macro that will check for duplicates in certain columns in a row of each Department and if duplicates excite then delete the matching row from Department 70.
The conditions: For comparing data I can only use the Names, Dates and Dollar Values which is in columns labeled 0-30 Days, 31-60 Days..etc.
If some rows are deleted from Department 70 then the account totals will need to be adjusted. That I believe I can figure it out, just stating that out there for your information.
-----------------------------------------------------------------------------
In "Department 70", I can only use ColumnB:H
Department 70 sample
------------------------------------------------------------------------------
[TABLE="width: 986"]
<tbody>[TR]
[TD="colspan: 2"]Department 70 Residence[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="colspan: 2"]ACCOUNT#: 1-026-70-00000-3405[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]MEMBER NUMBER[/TD]
[TD]MEMBER NAME[/TD]
[TD]TRN DATE[/TD]
[TD]0 -30 DAYS[/TD]
[TD]31-60 DAYS[/TD]
[TD]61-90 DAYS[/TD]
[TD]OVER 90 DAYS[/TD]
[TD]PAST DUE[/TD]
[/TR]
[TR]
[TD]026-500000031-00[/TD]
[TD]Holmes, Ollie[/TD]
[TD="align: right"]7/6/2016[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$606.60[/TD]
[TD="align: right"]$606.60[/TD]
[/TR]
[TR]
[TD]026-500000031-00[/TD]
[TD]Holmes, Ollie[/TD]
[TD="align: right"]7/6/2016[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$325.02[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$325.02[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]ACCOUNT TOTAL[/TD]
[TD][/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$325.02[/TD]
[TD="align: right"]$606.60[/TD]
[TD="align: right"]$931.62[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="colspan: 2"]ACCOUNT#: 1-026-70-00000-3411[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]MEMBER NUMBER[/TD]
[TD]MEMBER NAME[/TD]
[TD]TRN DATE[/TD]
[TD]0-30 DAYS[/TD]
[TD]31-60 DAYS[/TD]
[TD]61-90 DAYS[/TD]
[TD]OVER 90 DAYS[/TD]
[TD]PAST DUE[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]026-500184014-00[/TD]
[TD]Zhao, Ting[/TD]
[TD="align: right"]2/1/2015[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$507.96[/TD]
[TD="align: right"]$507.96[/TD]
[/TR]
[TR]
[TD]026-500184014-00[/TD]
[TD]Zhao, Ting[/TD]
[TD="align: right"]3/2/2015[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$507.96[/TD]
[TD="align: right"]$507.96[/TD]
[/TR]
[TR]
[TD]026-500184014-00[/TD]
[TD]Zhao, Ting[/TD]
[TD="align: right"]3/2/2015[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$507.96[/TD]
[TD="align: right"]$507.96[/TD]
[/TR]
[TR]
[TD]026-500184014-00[/TD]
[TD]Zhao, Ting[/TD]
[TD="align: right"]3/2/2015[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$507.96[/TD]
[TD="align: right"]$507.96[/TD]
[/TR]
[TR]
[TD]026-500184014-00[/TD]
[TD]Zhao, Ting[/TD]
[TD="align: right"]3/2/2015[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$507.96[/TD]
[TD="align: right"]$507.96[/TD]
[/TR]
[TR]
[TD]026-500184014-00[/TD]
[TD]Zhao, Ting[/TD]
[TD="align: right"]3/2/2015[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$507.96[/TD]
[TD="align: right"]$507.96[/TD]
[/TR]
[TR]
[TD]026-500184014-00[/TD]
[TD]Zhao, Ting[/TD]
[TD="align: right"]3/2/2015[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$507.96[/TD]
[TD="align: right"]$507.96[/TD]
[/TR]
[TR]
[TD]026-500184014-00[/TD]
[TD]Zhao, Ting[/TD]
[TD="align: right"]3/2/2015[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$507.96[/TD]
[TD="align: right"]$507.96[/TD]
[/TR]
[TR]
[TD]026-500184014-00[/TD]
[TD]Zhao, Ting[/TD]
[TD="align: right"]3/2/2015[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$507.96[/TD]
[TD="align: right"]$507.96[/TD]
[/TR]
[TR]
[TD]026-500184014-00[/TD]
[TD]Zhao, Ting[/TD]
[TD="align: right"]3/2/2015[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$507.96[/TD]
[TD="align: right"]$507.96[/TD]
[/TR]
[TR]
[TD]026-500184014-00[/TD]
[TD]Zhao, Ting[/TD]
[TD="align: right"]5/30/2015[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$507.96[/TD]
[TD="align: right"]$507.96[/TD]
[/TR]
[TR]
[TD]026-500184014-00[/TD]
[TD]Zhao, Ting[/TD]
[TD="align: right"]5/30/2015[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$507.96[/TD]
[TD="align: right"]$507.96[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]ACCOUNT TOTAL[/TD]
[TD][/TD]
[TD="align: right"]$2,006.18[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$19,881.00[/TD]
[TD="align: right"]$21,887.18[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD]GRAND TOTAL[/TD]
[TD="align: right"]$28,814.20[/TD]
[TD="align: right"]$9,144.17[/TD]
[TD="align: right"]$945.34[/TD]
[TD="align: right"]$43,694.18[/TD]
[TD="align: right"]$82,597.89[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
-----------------------------------------------------------------------------
In "Department 75", I can only use ColumnA, ColumnC:H but
ColumnC has two dates shown in the chart below, so I can only use the left 10 strings to match the date with department 70.
Department 75 sample
------------------------------------------------------------------------------
[TABLE="width: 986"]
<tbody>[TR]
[TD="colspan: 3"]Department 75 Club Service,General[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="colspan: 2"]ACCOUNT#: 1-026-75-00000-3414[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]MEMBER NUMBER[/TD]
[TD]MEMBER ROOM[/TD]
[TD]TRN DATE[/TD]
[TD]0 -30 DAYS[/TD]
[TD]31-60 DAYS[/TD]
[TD]61-90 DAYS[/TD]
[TD]OVER 90 DAYS[/TD]
[TD]PAST DUE[/TD]
[/TR]
[TR]
[TD]Brewer, Elliot[/TD]
[TD]842[/TD]
[TD]04/01/2017 05/01/2017[/TD]
[TD="align: right"]$234.17[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$234.17[/TD]
[/TR]
[TR]
[TD]Byrd, Malcolm (Patrick)[/TD]
[TD]874W[/TD]
[TD]04/01/2017 05/01/2017[/TD]
[TD="align: right"]$182.88[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$182.88[/TD]
[/TR]
[TR]
[TD]Dennis, Samuel[/TD]
[TD]878W[/TD]
[TD]03/01/2017 04/01/2017[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$541.18[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$541.18[/TD]
[/TR]
[TR]
[TD]Dennis, Samuel[/TD]
[TD]878W[/TD]
[TD]04/01/2017 05/01/2017[/TD]
[TD="align: right"]$198.43[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$198.43[/TD]
[/TR]
[TR]
[TD]Doskocz, Eliza[/TD]
[TD]656W[/TD]
[TD]04/01/2017 05/01/2017[/TD]
[TD="align: right"]$210.96[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$210.96[/TD]
[/TR]
[TR]
[TD]Foster, Eustacia[/TD]
[TD]762W[/TD]
[TD]01/14/2015 02/14/2015[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$34.64[/TD]
[TD="align: right"]$34.64[/TD]
[/TR]
[TR]
[TD]Foster, Eustacia[/TD]
[TD]762W[/TD]
[TD]03/14/2015 04/14/2015[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$584.64[/TD]
[TD="align: right"]$584.64[/TD]
[/TR]
[TR]
[TD]Foster, Eustacia[/TD]
[TD]762W[/TD]
[TD]04/14/2015 05/14/2015[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$584.64[/TD]
[TD="align: right"]$584.64[/TD]
[/TR]
[TR]
[TD]Foster, Eustacia[/TD]
[TD]762W[/TD]
[TD]05/14/2015 06/14/2015[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$584.64[/TD]
[TD="align: right"]$584.64[/TD]
[/TR]
[TR]
[TD]Foster, Eustacia[/TD]
[TD]762W[/TD]
[TD]02/14/2016 03/14/2016[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$584.64[/TD]
[TD="align: right"]$584.64[/TD]
[/TR]
[TR]
[TD]Foster, Eustacia[/TD]
[TD]762W[/TD]
[TD]06/14/2015 07/14/2015[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$584.64[/TD]
[TD="align: right"]$584.64[/TD]
[/TR]
[TR]
[TD]Zhao, Ting[/TD]
[TD]657W[/TD]
[TD]01/01/2016 02/01/2016[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$507.96[/TD]
[TD="align: right"]$507.96[/TD]
[/TR]
[TR]
[TD]Zhao, Ting[/TD]
[TD]657W[/TD]
[TD]05/01/2016 06/01/2016[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$507.96[/TD]
[TD="align: right"]$507.96[/TD]
[/TR]
[TR]
[TD]Zhao, Ting[/TD]
[TD]657W[/TD]
[TD]02/01/2016 03/01/2016[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$507.96[/TD]
[TD="align: right"]$507.96[/TD]
[/TR]
[TR]
[TD]Zhao, Ting[/TD]
[TD]657W[/TD]
[TD]03/01/2016 04/01/2016[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$507.96[/TD]
[TD="align: right"]$507.96[/TD]
[/TR]
[TR]
[TD]Zhao, Ting[/TD]
[TD]657W[/TD]
[TD]04/01/2016 05/01/2016[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$507.96[/TD]
[TD="align: right"]$507.96[/TD]
[/TR]
[TR]
[TD]Zhao, Ting[/TD]
[TD]657W[/TD]
[TD]06/01/2016 07/01/2016[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$507.96[/TD]
[TD="align: right"]$507.96[/TD]
[/TR]
[TR]
[TD]Zhao, Ting[/TD]
[TD]657W[/TD]
[TD]07/01/2016 08/01/2016[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$507.96[/TD]
[TD="align: right"]$507.96[/TD]
[/TR]
[TR]
[TD]Zhao, Ting[/TD]
[TD]657W[/TD]
[TD]08/01/2016 09/01/2016[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$507.96[/TD]
[TD="align: right"]$507.96[/TD]
[/TR]
[TR]
[TD]Zhao, Ting[/TD]
[TD]657W[/TD]
[TD]09/01/2016 10/01/2016[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$507.96[/TD]
[TD="align: right"]$507.96[/TD]
[/TR]
[TR]
[TD]Zhao, Ting[/TD]
[TD]657W[/TD]
[TD]10/01/2016 11/01/2016[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$507.96[/TD]
[TD="align: right"]$507.96[/TD]
[/TR]
[TR]
[TD]Zhao, Ting[/TD]
[TD]657W[/TD]
[TD]11/01/2016 12/01/2016[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$507.96[/TD]
[TD="align: right"]$507.96[/TD]
[/TR]
[TR]
[TD]Zhao, Ting[/TD]
[TD]657W[/TD]
[TD]12/01/2016 01/01/2017[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$507.96[/TD]
[TD="align: right"]$507.96[/TD]
[/TR]
[TR]
[TD]Zhao, Ting[/TD]
[TD]657W[/TD]
[TD]01/01/2017 02/01/2017[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$507.96[/TD]
[TD="align: right"]$507.96[/TD]
[/TR]
[TR]
[TD]Zhao, Ting[/TD]
[TD]657W[/TD]
[TD]02/01/2017 03/01/2017[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$507.96[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$507.96[/TD]
[/TR]
[TR]
[TD]Zhao, Ting[/TD]
[TD]657W[/TD]
[TD]03/01/2017 04/01/2017[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$507.96[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$507.96[/TD]
[/TR]
[TR]
[TD]Zhao, Ting[/TD]
[TD]657W[/TD]
[TD]04/01/2017 05/01/2017[/TD]
[TD="align: right"]$186.25[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$0.00[/TD]
[TD="align: right"]$186.25[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]ACCOUNT TOTAL[/TD]
[TD][/TD]
[TD="align: right"]$4,640.67[/TD]
[TD="align: right"]$5,335.48[/TD]
[TD="align: right"]$4,598.10[/TD]
[TD="align: right"]$61,208.45[/TD]
[TD="align: right"]$75,782.70[/TD]
[/TR]
</tbody>[/TABLE]
The code I have created so far but it doesn't work.
Code:
Sub Za_SHT02_FORMAT_Francisca()Sheets("Francisca").Activate
With ActiveSheet
str1 = Left(Range(c1), 10)
Set rng1 = Range(Range("B1"), Range("C1"), Range("D1"), Range("E1"), Range("F1"), Range("G1"), Range("H1").End(xlDown))
Set rng2 = Range(Range("A1"), str1.range, Range("D1"), Range("E1"), Range("F1"), Range("G1"), Range("H1").End(xlDown))
If rng1.Rows = rng2.Rows Then
rng1.RemoveDuplicates Columns:=Array(2, 3, 4, 5, 6, 7, 8), Header:=xlYes
End If
End With
End Sub
If you have questions please ask away.
Thank you in advance
Last edited: