Blakeskate
S1 Comes in this way and it can have a positive number on Col F Col G is Neg
#s
A B C D E F G
[TABLE="width: 485"]
<colgroup><col width="64" style="width: 48pt;"> <col width="84" style="width: 63pt; mso-width-source: userset; mso-width-alt: 3072;"> <col width="243" style="width: 182pt; mso-width-source: userset; mso-width-alt: 8886;"> <col width="64" style="width: 48pt;" span="4"> <tbody>[TR]
[TD="width: 64, bgcolor: transparent"]
Bank[/TD]
[TD="width: 84, bgcolor: transparent, align: right"]
8000052[/TD]
[TD="width: 243, bgcolor: transparent, align: right"]
221475896[/TD]
[TD="width: 64, bgcolor: transparent, align: right"]
43903[/TD]
[TD="width: 64, bgcolor: transparent"]
FNMA P&I PAYMENTS[/TD]
[TD="width: 64, bgcolor: transparent, align: right"]
0[/TD]
[TD="width: 64, bgcolor: transparent, align: right"]
0[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]
Bank[/TD]
[TD="bgcolor: transparent, align: right"]
8000052[/TD]
[TD="bgcolor: transparent, align: right"]
221475896[/TD]
[TD="bgcolor: transparent, align: right"]
43903[/TD]
[TD="bgcolor: transparent"]
FNMA P&I PAYMENTS[/TD]
[TD="bgcolor: transparent, align: right"]
0[/TD]
[TD="bgcolor: transparent, align: right"]
0[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]
Bank[/TD]
[TD="bgcolor: transparent, align: right"]
8000052[/TD]
[TD="bgcolor: transparent, align: right"]
221475896[/TD]
[TD="bgcolor: transparent, align: right"]
43903[/TD]
[TD="bgcolor: transparent"]
FNMA P&I PAYMENTS[/TD]
[TD="bgcolor: transparent, align: right"]
0[/TD]
[TD="bgcolor: transparent, align: right"]
-19929.6[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]
Bank[/TD]
[TD="bgcolor: transparent, align: right"]
70302410[/TD]
[TD="bgcolor: transparent, align: right"]
221475896[/TD]
[TD="bgcolor: transparent"]
800-025[/TD]
[TD="bgcolor: transparent"]
PAYMENTS CLEARING ACCOUNT[/TD]
[TD="bgcolor: transparent, align: right"]
0[/TD]
[TD="bgcolor: transparent, align: right"]
-3693.16[/TD]
[/TR]
</tbody>[/TABLE]
So, I want to copy and paste this file I am calling S1 into my Macro workbook on S1!
On my Macro Workbook - I have a complete cross reference Guide which looks like this
[TABLE="width: 293"]
<colgroup><col width="64" style="width: 48pt;"> <col width="84" style="width: 63pt; mso-width-source: userset; mso-width-alt: 3072;"> <col width="243" style="width: 182pt; mso-width-source: userset; mso-width-alt: 8886;"> <tbody>[TR]
[TD="width: 64, bgcolor: transparent, align: right"]
8000052[/TD]
[TD="width: 84, bgcolor: transparent, align: right"]
80000260000[/TD]
[TD="width: 243, bgcolor: transparent"]
FNMA MTG PYMNTS [/TD]
[/TR]
[TR]
[TD="bgcolor: transparent, align: right"]
70302410[/TD]
[TD="bgcolor: transparent, align: right"]
70400020000[/TD]
[TD="bgcolor: transparent"]
PORTFOLIO 15YR PRINC PYMNTS [/TD]
[/TR]
[TR]
[TD="bgcolor: transparent, align: right"]
7030011[/TD]
[TD="bgcolor: transparent, align: right"]
70300010000[/TD]
[TD="bgcolor: transparent"]
PORTFOLIO 20YR PRINC PYMNTS [/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"] [/TD]
[TD="bgcolor: transparent"] [/TD]
[TD="bgcolor: transparent"]
[/TD]
[/TR]
</tbody>[/TABLE]
S2 Contains all possible account
#s that I could get on the data I paste to S1.
The Final Result should be:
[TABLE="width: 333"]
<colgroup><col width="64" style="width: 48pt;"> <col width="84" style="width: 63pt; mso-width-source: userset; mso-width-alt: 3072;" span="2"> <col width="212" style="width: 159pt; mso-width-source: userset; mso-width-alt: 7753;"> <tbody>[TR]
[TD="width: 64, bgcolor: transparent, align: right"]
8000052[/TD]
[TD="width: 84, bgcolor: transparent, align: right"]
80000260000[/TD]
[TD="width: 84, bgcolor: transparent, align: right"]
-19929.59[/TD]
[TD="width: 212, bgcolor: transparent"]
FNMA MTG PYMNTS [/TD]
[/TR]
[TR]
[TD="bgcolor: transparent, align: right"]
7030010[/TD]
[TD="bgcolor: transparent, align: right"]
70400020000[/TD]
[TD="bgcolor: transparent, align: right"]
-3693.16[/TD]
[TD="bgcolor: transparent"]
PORTFOLIO 15YR PRINC PYMNTS [/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"] [/TD]
[TD="bgcolor: transparent"] [/TD]
[TD="bgcolor: transparent"] [/TD]
[TD="bgcolor: transparent"]
[/TD]
[/TR]
</tbody>[/TABLE]
Your code seems to work once I figure out what to move around.
In words - I prep S1 by doing =F+G on C >copy C paste special to C. Then E:G.Delete.
I then run this code to delete rows if =0 on C
Dim iRow As Long
Dim iCntr As Long
iRow = 500
For iCntr = iRow To 1 Step -1
If Cells(iCntr, 3) = 0 Then
Rows(iCntr).Delete
End If
Next
Now I Can use your code to match S1 Col B to S2 Col A. If it matches bring data in S2 Col A, B & C to S1 Col A, B & D.
If it is easier the code can bring data to S1 Col A, B, C and I can use simple code to arrange it my way.
The main task is to match It to the proper references