+ Reply to Thread
Results 1 to 5 of 5

Find value in sheets is not working as expected

  1. #1
    Registered User
    Join Date
    06-06-2019
    Location
    Lowestoft
    MS-Off Ver
    MS Excel 2016
    Posts
    2

    Find value in sheets is not working as expected

    I wrote this snippet of VBA code:

    Please Login or Register  to view this content.
    Aim: is to find the value "Weather" in the CurrentRegion around "A1", and if cell offset(0,1) to the "weather" cell address is empty, variable w is "No"; otherwise, variable w is "yes", and pop message box as described in the code.
    Issue: Code is finding value "Weather" in cell $H$13 (active cell with green frame) where apparently there is no such value, nor even hidden. (please see screenshot below with message box with: activecell address ($H$13), offset cell value (" ") and value to be found ("Weather"))error.png
    Question: Why is the function Find working like this? And how to correct that?

    Thank you very much in advance.

    Tiago
    Last edited by tiagom; 06-07-2019 at 10:43 AM.

  2. #2
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Re: Find value in sheets is not working as expected


    If the code is located in a standard module, Cells.Find means a search on the active worksheet …

    Just well read the VBA help of With … End With block statement and its sample.

  3. #3
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,694

    Re: Find value in sheets is not working as expected

    I don't know if I understand you right but if I do, this might be a start.
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    06-06-2019
    Location
    Lowestoft
    MS-Off Ver
    MS Excel 2016
    Posts
    2

    Re: Find value in sheets is not working as expected

    Thank you jolivanes, your script worked.

  5. #5
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,694

    Re: Find value in sheets is not working as expected

    Thank you for letting us know.
    Good luck

+ 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. [SOLVED] VBA Script not working as Expected
    By Blackhawks in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-01-2016, 09:01 PM
  2. [SOLVED] vlookup not working as expected
    By dmcgov in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 10-12-2016, 11:54 AM
  3. [SOLVED] =ISBLANK Not working as expected
    By Ra21V12eN in forum Excel General
    Replies: 5
    Last Post: 05-25-2016, 02:37 PM
  4. [SOLVED] IF/ELSEIF not working as expected
    By amphinomos in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-12-2015, 10:00 AM
  5. [SOLVED] 'Find' not working as expected (Excel vba).
    By staggers47 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-18-2013, 12:01 PM
  6. [SOLVED] Find method not working as (I) expected
    By bd528 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-09-2012, 11:24 AM
  7. =NETWORKDAYS not working as expected and as it once did
    By USAOz in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-13-2006, 10:05 AM

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