+ Reply to Thread
Results 1 to 6 of 6

Why does range evaluate to nothing following set statement

  1. #1
    Forum Contributor
    Join Date
    12-01-2007
    Location
    USA-North Carolina
    MS-Off Ver
    MS Office 2016
    Posts
    2,662

    Why does range evaluate to nothing following set statement

    I have two files. They have the same data in both files.

    I am trying to figure out why this

    Please Login or Register  to view this content.
    evaluates to nothing.

    Here is the code

    Please Login or Register  to view this content.
    Last edited by welchs101; 08-10-2011 at 07:33 AM.

  2. #2
    Forum Contributor
    Join Date
    12-01-2007
    Location
    USA-North Carolina
    MS-Off Ver
    MS Office 2016
    Posts
    2,662

    Re: Why does range evaluate to nothing following set statement

    ok, i am enclosing two files similar to what i am using in this macro.


    The code i am trying to understand is shown below:

    Consider the top 6 rows. For some reason this code says that these top six rows are not the same in each file...................ie............

    Please Login or Register  to view this content.
    the above evaluates to "Nothing". I did figure out that if i remove the "extend across cols" that it will work but i am not sure why it does not work when i do " have these extended"


    Can someone help me understand?






    Please Login or Register  to view this content.
    Attached Files Attached Files

  3. #3
    Forum Contributor
    Join Date
    12-01-2007
    Location
    USA-North Carolina
    MS-Off Ver
    MS Office 2016
    Posts
    2,662

    Re: Why does range evaluate to nothing following set statement

    i have another question i cant figure out..........

    rngSourceData.............what is this area/range?

    my thought was that it was the first 6 cols and first 6 rows but if you run the code it goes beyone the 6th row.........so i dont know what this range is.

    can somoene help?

  4. #4
    Forum Contributor
    Join Date
    12-01-2007
    Location
    USA-North Carolina
    MS-Off Ver
    MS Office 2016
    Posts
    2,662

    Re: Why does range evaluate to nothing following set statement

    i think i figured out what i needed to figure out..........still not 100% sure why this


    Set rngFinder = wksTarget.Columns(1).Find(What:=wksSource.Cells(rngCell.Row, 1), lookat:=xlWhole)


    evaluates to nothing......but i can live without knowing for now.

  5. #5
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Why does range evaluate to nothing following set statement

    hi, welchs101, hope this will help to answer your both questions. Variable testsh is defined as Worksheet object, it's default value is Nothing and as Sheet("Sheet1") is absent it remains equal to Nothing. If it's nothing selection is made visible on the first sheet, run code "test".
    Attached Files Attached Files

  6. #6
    Forum Contributor
    Join Date
    12-01-2007
    Location
    USA-North Carolina
    MS-Off Ver
    MS Office 2016
    Posts
    2,662

    Re: Why does range evaluate to nothing following set statement

    thanks........that does help.

+ 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