VBA Code for Bank Recos
Closed
moizuddin9
Posts
1
Registration date
Wednesday April 8, 2015
Status
Member
Last seen
April 8, 2015
-
Apr 8, 2015 at 02:52 AM
TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen December 27, 2022 - Apr 14, 2015 at 10:54 AM
TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen December 27, 2022 - Apr 14, 2015 at 10:54 AM
Related:
- VBA Code for Bank Recos
- Fenix internet on bank statement - Guide
- Battery reset code - Guide
- Samsung volume increase code - Guide
- Usa country code for whatsapp - Guide
- Cs 1.6 code - Guide
2 responses
TrowaD
Posts
2921
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
December 27, 2022
555
Apr 9, 2015 at 11:18 AM
Apr 9, 2015 at 11:18 AM
Hi Khaja,
Can a match only occur on the same row?
After your sample data has been processed will Sheet2 have 1 row?:
6-Apr 3006 700 5-Apr 3006 700
or 2 rows?:
6-Apr 3006 700
5-Apr 3006 700
So how does your sample data look like once it has been VBA'ed?
Best regards,
Trowa
Can a match only occur on the same row?
After your sample data has been processed will Sheet2 have 1 row?:
6-Apr 3006 700 5-Apr 3006 700
or 2 rows?:
6-Apr 3006 700
5-Apr 3006 700
So how does your sample data look like once it has been VBA'ed?
Best regards,
Trowa
TrowaD
Posts
2921
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
December 27, 2022
555
Apr 13, 2015 at 12:06 PM
Apr 13, 2015 at 12:06 PM
Hi Moizuddin,
Try the code below and see if it meets your requirements:
Best regards,
Trowa
Try the code below and see if it meets your requirements:
Sub RunMe() Dim lRow, x As Integer Sheets("Sheet1").Select lRow = Range("A1").End(xlDown).Row Do x = x + 1 If Cells(x, "B") & Cells(x, "C") = Cells(x, "E") & Cells(x, "F") Then Range(Cells(x, "A"), Cells(x, "C")).Copy Sheets("Sheet2").Range("A" & Rows.Count).End(xlUp).Offset(1, 0) Range(Cells(x, "D"), Cells(x, "F")).Copy Sheets("Sheet2").Range("A" & Rows.Count).End(xlUp).Offset(1, 0) Else Range(Cells(x, "A"), Cells(x, "C")).Copy Sheets("Sheet3").Range("A" & Rows.Count).End(xlUp).Offset(1, 0) Range(Cells(x, "D"), Cells(x, "F")).Copy Sheets("Sheet3").Range("A" & Rows.Count).End(xlUp).Offset(1, 0) End If Loop Until x = lRow End Sub
Best regards,
Trowa
Thanks dear for your effort. The code is working partially, i mean it's pasting the matched items in sheets2, but i want the matched items together in sheet2 for example i want my matched data in A1 & A2 , A3 & A4 so on. I think the code for sheet3 is not working, because its showing all the entries in sheet3, whereas i want only the unmatched items either from cash book or bank book in sheet3.
Please help me here
Please help me here
TrowaD
Posts
2921
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
December 27, 2022
555
Apr 14, 2015 at 10:54 AM
Apr 14, 2015 at 10:54 AM
Hi Moiz,
So you want to put the Date, Reference and Amount all in one cell?
You didn't answer my question from earlier:
Can a match only occur on the same row?
But if the answer is no then all the data has a match, right? So I assumed the answer would be yes.
This would mean that only the row with reference 3006 would go to sheet2 and the rest (as being data without a match) would go to sheet3.
So let me ask another question you didn't answer:
So how does your sample data look like once it has been VBA'ed (processed by VBA)?
Please clear the confusion by answering all the questions.
Best regards,
Trowa
So you want to put the Date, Reference and Amount all in one cell?
You didn't answer my question from earlier:
Can a match only occur on the same row?
But if the answer is no then all the data has a match, right? So I assumed the answer would be yes.
This would mean that only the row with reference 3006 would go to sheet2 and the rest (as being data without a match) would go to sheet3.
So let me ask another question you didn't answer:
So how does your sample data look like once it has been VBA'ed (processed by VBA)?
Please clear the confusion by answering all the questions.
Best regards,
Trowa
Apr 12, 2015 at 12:37 AM