Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 53
Default Macro to look for three rows of everything

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Macro to look for three rows of everything

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 53
Default Macro to look for three rows of everything

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 53
Default Macro to look for three rows of everything

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 53
Default Macro to look for three rows of everything

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 53
Default Macro to look for three rows of everything

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro code to hide rows and not calculate hidden rows bradmcq Excel Discussion (Misc queries) 0 September 1st 09 12:38 AM
Macro for deleting rows and serialising the remaing rows Srinivasulu Bhattaram Links and Linking in Excel 1 November 13th 08 08:44 AM
Macro for deleting rows and serialising the remaing rows Srinivasulu Bhattaram Setting up and Configuration of Excel 1 November 12th 08 06:05 PM
Macro for deleting rows and serialising the remaing rows Srinivasulu Bhattaram Excel Worksheet Functions 1 November 12th 08 01:39 PM
Help: Macro Adds Rows, Need to Update Totals with New rows Matt[_39_] Excel Programming 2 August 7th 06 05:06 PM


All times are GMT +1. The time now is 04:19 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"