+ Reply to Thread
Results 1 to 9 of 9

Declared variables in excel vba

  1. #1
    Registered User
    Join Date
    05-07-2013
    Location
    NJ, US
    MS-Off Ver
    Excel 2003, 2007, 2010 & 2013
    Posts
    10

    Question Declared variables in excel vba

    In Excel VBE, I can see a listing all the variables declared, subroutine names, etc in the Object Browser screen, under the Member of the VB Project. Is there a simple way to access this listing through VBA code? Basically, I am interested in generating a list of all the declared variables and then determining which of these variables have not been used.
    Currently, the alternative I am looking at is getting the declared lines from a VBIDE procedure and manipulating those lines. Since this listing seems to be already in Excel, I am wondering if there is a way to capture it through VBA codes.
    Thanks for any help I can get on this.
    Regards,
    RaliR

  2. #2
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Declared variables in excel vba

    Hi RALIR

    Go to this Web Site and download MZ Tools (freeware). It has a Utility that allows you to Review your Code and will tell you if Variables are not used. I use it every day.

    http://www.mztools.com/v3/download.aspx
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  3. #3
    Registered User
    Join Date
    05-07-2013
    Location
    NJ, US
    MS-Off Ver
    Excel 2003, 2007, 2010 & 2013
    Posts
    10

    Re: Declared variables in excel vba

    Hi John,

    Thank you for the quick response. I am familiar with MZTools and it worked well with Excel 2007, but unfortunately, it does not support Excel 2013. In addition, i am trying to get a listing of declared variables within VBA so that I can develop a robust debugging tool for my needs. If you have other thoughts, I would like to hear them.

    Thank you again.

    Regards,
    RaliR

  4. #4
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Declared variables in excel vba

    Hi RaliR

    Don't have 2013...but...I'll think on it...

  5. #5
    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,929

    Re: Declared variables in excel vba

    John, I looked at that site. It has a version that supposrts 2013 32 bit, but it does not support 64 bit

    (darn, just tried to run it here (at work) but I need admin permiission to install it)
    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

  6. #6
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Declared variables in excel vba

    @Ford

    This is Sunday
    just tried to run it here (at work)
    Pulled many of those myself...in the day

    I believe the OP is wanting to do something a bit different than MZTools can offer
    i am trying to get a listing of declared variables within VBA so that I can develop a robust debugging tool for my needs.
    Have no ideas at the moment...

  7. #7
    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,929

    Re: Declared variables in excel vba

    John, my week is Wed-Sun and my W/E is (normally) Mon/Tues - so for me its Friday lol

  8. #8
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Declared variables in excel vba

    @Ford

    Ah...I see. Well, when you retire, as I've been for going on 15 years, you'll find that EVERY day is a work day, especially if you have Children. I don't knock it...quite love it.

    Quote Originally Posted by FDibbins View Post
    John, my week is Wed-Sun and my W/E is (normally) Mon/Tues - so for me its Friday

  9. #9
    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,929

    Re: Declared variables in excel vba

    haha not that far off for me

+ 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. Do/Loop Until using variables declared
    By LLL0422 in forum Excel Programming / VBA / Macros
    Replies: 33
    Last Post: 06-05-2014, 09:01 AM
  2. Problem with public global declared variables
    By vonb3ta in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-03-2013, 07:20 AM
  3. [SOLVED] Macro for autofilter using variables declared in worksheet
    By Dave Peterson in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-06-2005, 06:05 AM
  4. [SOLVED] Macro for autofilter using variables declared in worksheet
    By Jeff in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 01:05 AM
  5. Macro for autofilter using variables declared in worksheet
    By Jeff in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 10:05 PM

Tags for this Thread

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