+ Reply to Thread
Results 1 to 11 of 11

Find function and Intersect

  1. #1
    Registered User
    Join Date
    05-26-2011
    Location
    48067
    MS-Off Ver
    Excel 2007
    Posts
    12

    Find function and Intersect

    Hey Guys,

    I'm trying to use the .Find function to find a specific value 'tbName' in a Range that I set in the worksheet: "Income"

    the error is "application defined or object defined error" on the 'Set' line.

    I want Rng to be the Cell address where the tbName value is found

    Please Login or Register  to view this content.
    Last edited by mpalm; 05-27-2011 at 01:03 PM.

  2. #2
    Forum Expert Colin Legg's Avatar
    Join Date
    03-30-2008
    Location
    UK
    MS-Off Ver
    365
    Posts
    1,256

    Re: .Find function problems

    Hi,

    Start by taking of the address (which returns a string literal):

    Please Login or Register  to view this content.
    Hope that helps,

    Colin

    RAD Excel Blog

  3. #3
    Registered User
    Join Date
    05-26-2011
    Location
    48067
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: .Find function problems

    Thanks, but unfortunately that gives me the same error as before.

    Am I using the code correctly even? or is there a better way to do this?

  4. #4
    Forum Expert Colin Legg's Avatar
    Join Date
    03-30-2008
    Location
    UK
    MS-Off Ver
    365
    Posts
    1,256

    Re: .Find function problems

    Hard to say... if you change the code to the below, what is printed into the immediate window (Visual Basic Editor > View > Immediate Window)?

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    05-26-2011
    Location
    48067
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: .Find function problems

    The values "Income" and "1" ( the immediate window shows them without the quotes)

    "Income" is a range I have set in the worksheet, and "1" is a test name that is in the range that I am searching for

  6. #6
    Forum Expert Colin Legg's Avatar
    Join Date
    03-30-2008
    Location
    UK
    MS-Off Ver
    365
    Posts
    1,256

    Re: .Find function problems

    Okay, well I just quickly tried it and it worked for me.

    Because of the error message, the first things to check are that the named range you've set up definitely sits on the Overview 2011 worksheet, and that it is definitely called "Income".

    If both of those look okay then perhaps you could attach a sample workbook for us to see?

  7. #7
    Registered User
    Join Date
    05-26-2011
    Location
    48067
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: .Find function problems

    Ahh I got it now - I had the incorrect Sheet name. It works now.

    Another question then, more general this time. Now that I have found the value I need, I want to be able to offset along that row until I reach another cell in a range. Lets say that in the Row with the name "1" I want to offset to the right until I find a cell in the range "January".

    How would I accomplish that?

    Thanks for your help so far!

  8. #8
    Forum Expert Colin Legg's Avatar
    Join Date
    03-30-2008
    Location
    UK
    MS-Off Ver
    365
    Posts
    1,256

    Re: .Find function problems

    Hi,

    Using your current methodology, it would be something like:

    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    05-26-2011
    Location
    48067
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: .Find function problems

    It seems like that is looking for the value "january" in the current row. I want it to just find the cell in the current row that is also in the column range "january".

  10. #10
    Forum Expert Colin Legg's Avatar
    Join Date
    03-30-2008
    Location
    UK
    MS-Off Ver
    365
    Posts
    1,256

    Re: .Find function problems

    Oh, I see. Like this?

    Please Login or Register  to view this content.

  11. #11
    Registered User
    Join Date
    05-26-2011
    Location
    48067
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: (<-excellently) .Find function and Intersect problems

    Perfect! I knew there must be an easy way to do that.

    Cheers!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1