The Child Who Played with the Moon and the Stars (meerasedai) wrote in thequestionclub,
The Child Who Played with the Moon and the Stars

As much as I HATE it, I have to do something in VBA for some spreadsheets and I'm stuck. Anyone willing to help?

So I have two worksheets each with a column of numbers. I want to see which numbers are the same and create a separate worksheet that displays the rows that describe those two sets of data. Here's the part that's making me want to scream:

Dim rFoundRange as Range

For Each c In Worksheets("sequest").Range("G:G").cells
    Set rFoundCell = Worksheets("pic").Columns("D").Find(what: c.value)
    If Not rFoundCell Is Nothing Then

I get a runtime error saying that there's a type mis-match right at the line of code that's in red. Why?!?! I set the variable the Range and the Find method returns a Range object. What am I missing? I hope this isn't stupid.

  • Post a new comment


    Comments allowed for members only

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded