Please Help!

  • Thread starter Thread starter Damil4real
  • Start date Start date
D

Damil4real

I have a spreadsheet that matches a value in one column to another...,
basically to check for duplicates...then the duplicates show up in
another column. I want macro to count the number of matched values and
return a comment that states that "X number of matches are found." If
there were no matches, it should say "No Matches Found."

I appreciate your assistance.

Thanks!
 
In which group would you like your answer. Pls post in ONLY one.
 
You can answer it here. Thanks!


In which group would you like your answer. Pls post in ONLY one.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software







- Show quoted text -

You can answer it here. Thanks!
 
I searched for FINDNEXT but the results didn't help with my specific
question.

Any other ways you can assist?

Sample sheet looks like this:

Column A | B | E |

1125 | | 1154 |

Formula in Column B is:

=IF(ISERROR(MATCH(A6,$E$7:$E$66,0)),"",A6)

Then I click on a cell that has the below macro embedded in it.

Sub Find_Matches()
Dim CompareRange As Variant, x As Variant, y As Variant
' Set CompareRange equal to the range to which you will
' compare the selection.
Set CompareRange = Range("C3:C200")
' NOTE: If the compare range is located on another workbook
' or worksheet, use the following syntax.
' Set CompareRange = Workbooks("Book2"). _
' Worksheets("Sheet2").Range("C1:C5")
'
' Loop through each cell in the selection and compare it to
' each cell in CompareRange.
For Each x In Selection
For Each y In CompareRange
If x = y Then x.Offset(0, 1) = x
Next y
Next x
End Sub

I want the macro to pop up a message that says the number of matches
that was found, if any. If nothing, it should say something like "0
matches found."

Thanks for your continued assistance.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top