+ Reply to Thread
Results 1 to 5 of 5

How to see values in code

  1. #1
    Forum Contributor
    Join Date
    08-14-2013
    Location
    LA Baby!!
    MS-Off Ver
    Excel 2007
    Posts
    1,598

    How to see values in code

    Hello. Sometimes as I hit F8 through code, I can see the values of what's happening for example looping through i. Sometimes I can't though and I'd like to know why!!

    Please Login or Register  to view this content.
    I would like to see the value of value. Obviously it doesn't meet the criteria it will skip the if message but I'd still like to know haha.

  2. #2
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: How to see values in code

    In your example the reason you are not seeing the value is because of the declaration of the Sheet, or lack thereof.

    Please Login or Register  to view this content.
    Note: A lot of time is it prudent to use the immediate window and Debug.Print to see what is happening in code.

  3. #3
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,811

    Re: How to see values in code

    I use the Watch window for this sort of thing. Set a watch for the desired object, and you will be able to know what is in that variable as you step through the code. http://cis.poly.edu/~mleung/CS394/f0...tchWindow.html

    You can also use the debug.print statement in the immediate window to view a variable or objects .value property.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: How to see values in code

    The Locals window will show the values of all in-scope variables. I rarely use the Watch window.
    Last edited by shg; 03-13-2015 at 12:07 PM.
    Entia non sunt multiplicanda sine necessitate

  5. #5
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: How to see values in code

    There is also debug.print which will show up in the Immediate window
    Please help by:

    Marking threads as closed once your issue is resolved. How? The Thread Tools at the top
    Any reputation (*) points appreciated. Not just by me, but by all those helping, so if you found someone's input useful, please take a second to click the * at the bottom left to let them know

    There are 10 kinds of people in this world... those who understand binary, and those who don't.

+ 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. Replies: 20
    Last Post: 11-27-2014, 02:37 AM
  2. [SOLVED] the code is finding repeated values but i need to search values from E column to D
    By baig123 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-14-2014, 01:33 AM
  3. Replies: 2
    Last Post: 06-04-2012, 06:57 AM
  4. Passing variables and values between sheet code and module code
    By imux in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 05-14-2009, 12:23 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