Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi there,
I need a macro to look down say columns A B and C and find three rows which match in amount, date, and order number. I would prefferably like to have it look for a specific entry in that column D must be say X and Columns A B and C match. And another row that says Y andcolumns A B and C match. And another one that says Z and columns A B and C match. The thing is my system needs to have three rows which are the same to be input in different systems. I need to check to see if any data from Z above is missing from X and Y.and then reinput them manually to make sure all three of the accounts are matching, I hope this makes sense to someone, Thanks Andrea |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
this code will find all the rows where columns A B C match and display the
number of times each combination is found. You will have to modify the code to meet all your requirments. try the code and let me know how it needs to be modified. Sub findtriples() Lastrow = Cells(Rows.Count, "A").End(xlUp).Row For RowCount = 1 To Lastrow 'Make sure data didn't appear earlier Found = False For OldRowCount = 1 To (RowCount - 1) If Cells(RowCount, "A") = Cells(OldRowCount, "A") And _ Cells(RowCount, "B") = Cells(OldRowCount, "B") And _ Cells(RowCount, "C") = Cells(OldRowCount, "C") Then Found = True Exit For End If Next OldRowCount If Found = False Then 'Count number of times combination is found TimesFound = 1 RowsFound = CStr(RowCount) For NewRowCount = (RowCount + 1) To Lastrow If Cells(RowCount, "A") = Cells(NewRowCount, "A") And _ Cells(RowCount, "B") = Cells(NewRowCount, "B") And _ Cells(RowCount, "C") = Cells(NewRowCount, "C") Then TimesFound = TimesFound + 1 RowsFound = RowsFound & "," & CStr(NewRowCount) End If Next NewRowCount ABCData = CStr(Cells(RowCount, "A")) & ", " & _ CStr(Cells(RowCount, "B")) & ", " & _ CStr(Cells(RowCount, "C")) MsgBox ("Row " & CStr(RowCount) & _ " data was found " & CStr(TimesFound) & _ " time(s)" & Chr(10) & _ "Data = " & ABCData & Chr(10) & _ "Row(s) = " & RowsFound) End If Next RowCount End Sub " wrote: Hi there, I need a macro to look down say columns A B and C and find three rows which match in amount, date, and order number. I would prefferably like to have it look for a specific entry in that column D must be say X and Columns A B and C match. And another row that says Y andcolumns A B and C match. And another one that says Z and columns A B and C match. The thing is my system needs to have three rows which are the same to be input in different systems. I need to check to see if any data from Z above is missing from X and Y.and then reinput them manually to make sure all three of the accounts are matching, I hope this makes sense to someone, Thanks Andrea |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks Joel
Will give a try tomorrow and let you now, Many thanks Andrea On 3 Jun, 14:18, Joel wrote: this code will find all the rows where columns A B C match and display the number of times each combination is found. You will have to modify the code to meet all your requirments. try the code and let me know how it needs to be modified. Sub findtriples() Lastrow = Cells(Rows.Count, "A").End(xlUp).Row For RowCount = 1 To Lastrow 'Make sure data didn't appear earlier Found = False For OldRowCount = 1 To (RowCount - 1) If Cells(RowCount, "A") = Cells(OldRowCount, "A") And _ Cells(RowCount, "B") = Cells(OldRowCount, "B") And _ Cells(RowCount, "C") = Cells(OldRowCount, "C") Then Found = True Exit For End If Next OldRowCount If Found = False Then 'Count number of times combination is found TimesFound = 1 RowsFound = CStr(RowCount) For NewRowCount = (RowCount + 1) To Lastrow If Cells(RowCount, "A") = Cells(NewRowCount, "A") And _ Cells(RowCount, "B") = Cells(NewRowCount, "B") And _ Cells(RowCount, "C") = Cells(NewRowCount, "C") Then TimesFound = TimesFound + 1 RowsFound = RowsFound & "," & CStr(NewRowCount) End If Next NewRowCount ABCData = CStr(Cells(RowCount, "A")) & ", " & _ CStr(Cells(RowCount, "B")) & ", " & _ CStr(Cells(RowCount, "C")) MsgBox ("Row " & CStr(RowCount) & _ " data was found " & CStr(TimesFound) & _ " time(s)" & Chr(10) & _ "Data = " & ABCData & Chr(10) & _ "Row(s) = " & RowsFound) End If Next RowCount End Sub " wrote: Hi there, I need a macro to look down say columns A B and C and find three rows which match in amount, date, and order number. I would prefferably like to have it look for a specific entry in that column D must be say X and Columns A B and C match. And another row that says Y andcolumns A B and C match. And another one that says Z and columns A B and C match. The thing is my system needs to have three rows which are the same to be input in different systems. I need to check to see if any data from Z above is missing from X and Y.and then reinput them manually to make sure all three of the accounts are matching, I hope this makes sense to someone, Thanks Andrea- Hide quoted text - - Show quoted text - |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Joel,
This does what I need, Rather than a message box is there a way they can be sorted in order of the number of time they appear so I can easily identify the items which don't appear three times or fours time? Can the amount of times I expect to see it be variable? Thanks Andrea On 3 Jun, 23:51, " wrote: Thanks Joel Will give a try tomorrow and let you now, Many thanks Andrea On 3 Jun, 14:18, Joel wrote: this code will find all the rows where columns A B C match and display the number of times each combination is found. You will have to modify the code to meet all your requirments. try the code and let me know how it needs to be modified. Sub findtriples() Lastrow = Cells(Rows.Count, "A").End(xlUp).Row For RowCount = 1 To Lastrow 'Make sure data didn't appear earlier Found = False For OldRowCount = 1 To (RowCount - 1) If Cells(RowCount, "A") = Cells(OldRowCount, "A") And _ Cells(RowCount, "B") = Cells(OldRowCount, "B") And _ Cells(RowCount, "C") = Cells(OldRowCount, "C") Then Found = True Exit For End If Next OldRowCount If Found = False Then 'Count number of times combination is found TimesFound = 1 RowsFound = CStr(RowCount) For NewRowCount = (RowCount + 1) To Lastrow If Cells(RowCount, "A") = Cells(NewRowCount, "A") And _ Cells(RowCount, "B") = Cells(NewRowCount, "B") And _ Cells(RowCount, "C") = Cells(NewRowCount, "C") Then TimesFound = TimesFound + 1 RowsFound = RowsFound & "," & CStr(NewRowCount) End If Next NewRowCount ABCData = CStr(Cells(RowCount, "A")) & ", " & _ CStr(Cells(RowCount, "B")) & ", " & _ CStr(Cells(RowCount, "C")) MsgBox ("Row " & CStr(RowCount) & _ " data was found " & CStr(TimesFound) & _ " time(s)" & Chr(10) & _ "Data = " & ABCData & Chr(10) & _ "Row(s) = " & RowsFound) End If Next RowCount End Sub " wrote: Hi there, I need a macro to look down say columns A B and C and find three rows which match in amount, date, and order number. I would prefferably like to have it look for a specific entry in that column D must be say X and Columns A B and C match. And another row that says Y andcolumns A B and C match. And another one that says Z and columns A B and C match. The thing is my system needs to have three rows which are the same to be input in different systems. I need to check to see if any data from Z above is missing from X and Y.and then reinput them manually to make sure all three of the accounts are matching, I hope this makes sense to someone, Thanks Andrea- Hide quoted text - - Show quoted text -- Hide quoted text - - Show quoted text - |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Can someone help with this?
I just want Josh's macro to highlight the rows that are found less than three time in red and also place in cell in column G how many time it has appeared, Hope this makes sense.... THanks alot Andrea On 5 Jun, 13:23, " wrote: Hi Joel, This does what I need, Rather than a message box is there a way they can be sorted in order of the number of time they appear so I can easily identify the items which don't appear three times or fours time? Can the amount of times I expect to see it be variable? Thanks Andrea On 3 Jun, 23:51, " wrote: Thanks Joel Will give a try tomorrow and let you now, Many thanks Andrea On 3 Jun, 14:18, Joel wrote: this code will find all the rows where columns A B C match and display the number of times each combination is found. You will have to modify the code to meet all your requirments. try the code and let me know how it needs to be modified. Sub findtriples() Lastrow = Cells(Rows.Count, "A").End(xlUp).Row For RowCount = 1 To Lastrow 'Make sure data didn't appear earlier Found = False For OldRowCount = 1 To (RowCount - 1) If Cells(RowCount, "A") = Cells(OldRowCount, "A") And _ Cells(RowCount, "B") = Cells(OldRowCount, "B") And _ Cells(RowCount, "C") = Cells(OldRowCount, "C") Then Found = True Exit For End If Next OldRowCount If Found = False Then 'Count number of times combination is found TimesFound = 1 RowsFound = CStr(RowCount) For NewRowCount = (RowCount + 1) To Lastrow If Cells(RowCount, "A") = Cells(NewRowCount, "A") And _ Cells(RowCount, "B") = Cells(NewRowCount, "B") And _ Cells(RowCount, "C") = Cells(NewRowCount, "C") Then TimesFound = TimesFound + 1 RowsFound = RowsFound & "," & CStr(NewRowCount) End If Next NewRowCount ABCData = CStr(Cells(RowCount, "A")) & ", " & _ CStr(Cells(RowCount, "B")) & ", " & _ CStr(Cells(RowCount, "C")) MsgBox ("Row " & CStr(RowCount) & _ " data was found " & CStr(TimesFound) & _ " time(s)" & Chr(10) & _ "Data = " & ABCData & Chr(10) & _ "Row(s) = " & RowsFound) End If Next RowCount End Sub " wrote: Hi there, I need a macro to look down say columns A B and C and find three rows which match in amount, date, and order number. I would prefferably like to have it look for a specific entry in that column D must be say X and Columns A B and C match. And another row that says Y andcolumns A B and C match. And another one that says Z and columns A B and C match. The thing is my system needs to have three rows which are the same to be input in different systems. I need to check to see if any data from Z above is missing from X and Y.and then reinput them manually to make sure all three of the accounts are matching, I hope this makes sense to someone, Thanks Andrea- Hide quoted text - - Show quoted text -- Hide quoted text - - Show quoted text -- Hide quoted text - - Show quoted text - |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Joel,
In this macro you created there was one thing ommitted which I have just found out today from using your macro.....I don't know how easy it is to change..... There must be one entry from each of the banking systems I use, for example a HSBC, CITIBANK, BANKOFAMERICA.....these are located in column A all the data should match.....so if the transaction has gone through HSBC I want to make sure it's also gone through the other two banks. And also anything that has gone through the other two banks that hasnt gone through the HSBC bank account. All I want to make sure is that all bank accounts are the same...... I hope you can help change your macro and sorry....i didnt think this would be an issue but I only noticed today that HSBC had three transactions going through and this was omitted from the other two bank accounts but I didnt check because it had appeated 3 times........ Thanks so much, Andrea On 3 Jun, 14:18, Joel wrote: this code will find all the rows where columns A B C match and display the number of times each combination is found. You will have to modify the code to meet all your requirments. try the code and let me know how it needs to be modified. Subfindtriples() Lastrow = Cells(Rows.Count, "A").End(xlUp).Row For RowCount = 1 To Lastrow 'Make sure data didn't appear earlier Found = False For OldRowCount = 1 To (RowCount - 1) If Cells(RowCount, "A") = Cells(OldRowCount, "A") And _ Cells(RowCount, "B") = Cells(OldRowCount, "B") And _ Cells(RowCount, "C") = Cells(OldRowCount, "C") Then Found = True Exit For End If Next OldRowCount If Found = False Then 'Count number of times combination is found TimesFound = 1 RowsFound = CStr(RowCount) For NewRowCount = (RowCount + 1) To Lastrow If Cells(RowCount, "A") = Cells(NewRowCount, "A") And _ Cells(RowCount, "B") = Cells(NewRowCount, "B") And _ Cells(RowCount, "C") = Cells(NewRowCount, "C") Then TimesFound = TimesFound + 1 RowsFound = RowsFound & "," & CStr(NewRowCount) End If Next NewRowCount ABCData = CStr(Cells(RowCount, "A")) & ", " & _ CStr(Cells(RowCount, "B")) & ", " & _ CStr(Cells(RowCount, "C")) MsgBox ("Row " & CStr(RowCount) & _ " data was found " & CStr(TimesFound) & _ " time(s)" & Chr(10) & _ "Data = " & ABCData & Chr(10) & _ "Row(s) = " & RowsFound) End If Next RowCount End Sub " wrote: Hi there, I need a macro to look down say columns A B and C and find three rows which match in amount, date, and order number. I would prefferably like to have it look for a specific entry in that column D must be say X and Columns A B and C match. And another row that says Y andcolumns A B and C match. And another one that says Z and columns A B and C match. The thing is my system needs to have three rows which are the same to be input in different systems. I need to check to see if any data from Z above is missing from X and Y.and then reinput them manually to make sure all three of the accounts are matching, I hope this makes sense to someone, Thanks Andrea- Hide quoted text - - Show quoted text - |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro code to hide rows and not calculate hidden rows | Excel Discussion (Misc queries) | |||
Macro for deleting rows and serialising the remaing rows | Links and Linking in Excel | |||
Macro for deleting rows and serialising the remaing rows | Setting up and Configuration of Excel | |||
Macro for deleting rows and serialising the remaing rows | Excel Worksheet Functions | |||
Help: Macro Adds Rows, Need to Update Totals with New rows | Excel Programming |