[Webinar] Streamline your web hosting managementRegister Today


Cross reference Variable in Excel VBA

Posted on 2010-04-02
Medium Priority
Last Modified: 2012-05-09

I've written number of routines in Excel VBA and some are now quite large.  

Is there a utility that I can use to cross reference the variables in my code, so that I can see on which line[s] each variable is used?
Question by:johndl
  • 2
LVL 43

Accepted Solution

Saqib Husain, Syed earned 1050 total points
ID: 29448170
What you can do is copy the code to an Excel sheet and either write a formula to identify the lines containing the variables or use data filter to isolate them.
LVL 13

Assisted Solution

lee555J5 earned 450 total points
ID: 29450915
Many times for VBA and LISP programming, I will copy my code out to Notepad++ (available here http://notepad-plus.sourceforge.net/uk/site.htm). It has language syntax highlighting, and--here is what you may be looking for--you can double-click any text and Notepad++ auto-highlights that text wherever else it appears in that code. It is also great for matching open/close parentheses, brackets, and braces.

Author Comment

ID: 29541531
Thanks to both contributions.  I had hoped I'd get a ready made solution, but it seems not so far!

I may have to use soemthing like ssaqibh suggests, but I had hoped to avoid having to write a load of code to do the sorting.  lee555J5's suggestion also looks rather laborious when there's a lot of source code to analyse, but the Notepad++ popgram he highlights looks very useful for many other tasks.

I'll do a Micawber, for a while, in the hope of something turning up.


Author Closing Comment

ID: 31710227
Neither solution really solved the problem.  I ended up writing a cross-reference macro myself to do that.  The solutions offered did give some help though.

Featured Post

2018 Annual Membership Survey

Here at Experts Exchange, we strive to give members the best experience. Help us improve the site by taking this survey today! (Bonus: Be entered to win a great tech prize for participating!)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
Simple Linear Regression
Enter Foreign and Special Characters Enter characters you can't find on a keyboard using its ASCII code ... and learn how to make a handy reference for yourself using Excel ~ Use these codes in any Windows application! ... whether it is a Micr…

613 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question