+ Reply to Thread
Results 1 to 6 of 6

Referencing cell contents giving incorrect result.

  1. #1
    Forum Contributor
    Join Date
    07-20-2015
    Location
    Jacksonville, Florida
    MS-Off Ver
    Excel 2016
    Posts
    313

    Referencing cell contents giving incorrect result.

    I am trying to reference a cell on the active worksheet and I know the cell has a value of 10 but when I single step thru in VBA and hover over the cell name (BS3) It displays 'empty'.

    Don't know how that can happen please see attachment. Not sure If I'm referring to the cell correctly. I tried referencing the cell as R3C71 also but got the same result.

    Thanks for any help or ideas
    Attached Files Attached Files

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,364

    Re: Referencing cell contents giving incorrect result.

    Look at the difference between the Select and the If. BS3 refers to an undefined variable, not the Range("BS3")


    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: Referencing cell contents giving incorrect result.

    If you already have the workbook, why not upload a sample of that, rather than (maybe?) a pic in a word document?
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Forum Contributor
    Join Date
    07-20-2015
    Location
    Jacksonville, Florida
    MS-Off Ver
    Excel 2016
    Posts
    313

    Re: Referencing cell contents giving incorrect result.

    Actually, this was simpler since my workbook is way to large to load to the forum and I'd need to cut it down in size, which I can do if necessary but I believe TMS has given the solution. If not I will take your advice and cut down the size and number of worksheets and send that in.

    Thanks

  5. #5
    Forum Contributor
    Join Date
    07-20-2015
    Location
    Jacksonville, Florida
    MS-Off Ver
    Excel 2016
    Posts
    313

    Re: Referencing cell contents giving incorrect result.

    Thanks for the heads up, I made the change per your advice and it works perfectly. I will close the thread now.

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,364

    Re: Referencing cell contents giving incorrect result.

    You're welcome. Thanks for the rep.

+ 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. MATCH function is giving me incorrect row?
    By Toby21 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 05-02-2014, 05:29 PM
  2. SUMIF formuka is giving the incorrect result?
    By Aland2929 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 11-17-2013, 10:47 AM
  3. [SOLVED] ROUND formula giving incorrect result
    By Marvo in forum Excel General
    Replies: 11
    Last Post: 08-19-2012, 12:15 PM
  4. Array Formulas Giving incorrect value
    By ChemistB in forum Excel General
    Replies: 6
    Last Post: 02-28-2011, 01:16 PM
  5. Input Box giving incorrect results
    By jamesryan in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-16-2009, 07:31 AM
  6. cell formulae giving negative result.
    By BrianC500 in forum Excel General
    Replies: 7
    Last Post: 07-25-2006, 05:10 AM
  7. Formula giving incorrect answer...
    By Jambruins in forum Excel General
    Replies: 3
    Last Post: 02-25-2005, 03:06 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