+ Reply to Thread
Results 1 to 5 of 5

Testing if cell is in range function not returning correctly

  1. #1
    Forum Contributor
    Join Date
    02-25-2013
    Location
    Colorado, US
    MS-Off Ver
    Microsoft 365 Apps
    Posts
    518

    Testing if cell is in range function not returning correctly

    Why? Can anybody see why this shouldn't work? Stepping through, the rng is not being recognized when the function is called. I've debugged the sub and rng within the sub and it is declared correctly. Why would there be any reason the function does not recognize it?
    Please Login or Register  to view this content.

  2. #2
    Valued Forum Contributor
    Join Date
    06-27-2010
    Location
    sYRIA
    MS-Off Ver
    Excel 2013
    Posts
    669

    Re: Testing if cell is in range function not returning correctly

    Hi
    you've missd to declare rng
    Please Login or Register  to view this content.

  3. #3
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,516

    Re: Testing if cell is in range function not returning correctly

    Hi there,

    For what it's worth:

    I don't have access to your "LastRow" function, so I just assigned a value of ten to the variable "Last"

    Running the "IsItInThere" routine when the active cell was in the range A2:A10 produced no output. Running it when the active cell was outside this range produced your "Select from master sheet" message.

    Hope this helps.

    Regards,

    Greg M

  4. #4
    Forum Contributor
    Join Date
    02-25-2013
    Location
    Colorado, US
    MS-Off Ver
    Microsoft 365 Apps
    Posts
    518

    Re: Testing if cell is in range function not returning correctly

    everything is declared.

  5. #5
    Forum Contributor
    Join Date
    02-25-2013
    Location
    Colorado, US
    MS-Off Ver
    Microsoft 365 Apps
    Posts
    518

    Re: Testing if cell is in range function not returning correctly

    cell is in Col D. Forgot A:C were minimized. Can't believe I overlooked this one. Thanks for the prompt.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Application vlookup is not returning value correctly
    By reachharry in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-18-2020, 09:48 PM
  2. [SOLVED] IF function not returning values correctly (what did I miss)
    By Dan_B in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-09-2019, 09:40 AM
  3. Cell Address function returning error in a range
    By melcf in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-09-2018, 04:35 AM
  4. IF Function is not reading a Lookup cell correctly
    By synkronized_jc in forum Excel General
    Replies: 6
    Last Post: 11-23-2016, 07:12 AM
  5. Replies: 4
    Last Post: 12-28-2014, 02:43 PM
  6. Returning a range from a function
    By Kim1974 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 05-23-2011, 12:12 PM
  7. Function not returning correctly please look
    By AA76 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-27-2006, 04:45 PM

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