Finding variables in code

  • Thread starter Thread starter Ian
  • Start date Start date
I

Ian

Is there any way to list all the variables used in a VBA project? I would
prefer this to also list the subroutines they occur in, but that's not
essential.

ian
 
Is there any way to list all the variables used in a VBA project? I would
prefer this to also list the subroutines they occur in, but that's not
essential.

ian

There are a great many programs out there - see here:
http://code-snippet-manager.qarchive.org/

What I have done is this:
Copy all the code from the VBE, paste it into excel, then delete all
rows that don't start with "Private", "Public" or "Dim" ....

HTH

Chris
 
Thanks, Chris, but I was hoping for something free. This costs $40.

Your DIY method will only work if all the variables have a Dim line
associated with them, which is certainly not he case with the code I'm
trying to fathom just now.

Ian

Is there any way to list all the variables used in a VBA project? I would
prefer this to also list the subroutines they occur in, but that's not
essential.

ian

There are a great many programs out there - see here:
http://code-snippet-manager.qarchive.org/

What I have done is this:
Copy all the code from the VBE, paste it into excel, then delete all
rows that don't start with "Private", "Public" or "Dim" ....

HTH

Chris
 
Thanks, Chris, but I was hoping for something free. This costs $40.

Your DIY method will only work if all the variables have a Dim line
associated with them, which is certainly not he case with the code I'm
trying to fathom just now.

Ian





There are a great many programs out there - see here:http://code-snippet-manager.qarchive.org/

What I have done is this:
Copy all the code from the VBE, paste it into excel, then delete all
rows that don't start with "Private", "Public" or "Dim" ....

HTH

Chris

No proper declarations? Eep! Put "Option Explicit" at the very top of
every Module, and start declaring (may be too much work, but might be
worth it?)

I did another google search, and I don't see anything for free ... I
bet that one of the experts will have something, though :)

Chris
 
No proper declarations? Eep! Put "Option Explicit" at the very top of
every Module, and start declaring (may be too much work, but might be
worth it?)

I did another google search, and I don't see anything for free ... I
bet that one of the experts will have something, though :)

Chris- Hide quoted text -

- Show quoted text -

Hi,

Not sure exactly what you need to achieve, but within the VBA
environment, you could try upening the 'Locals' window. Head for
'View' -> 'Locals'. Once this is visible, step through your code and
all the active variables will be listed with their values and types.
Might help you.

Cheers,
Ivan.
 
Hi Ivan

All I was hoping for was a list of the variables and ideally which
subroutines they are used in. This is even better.

Absolutely perfect!

Many thanks.

Ian
No proper declarations? Eep! Put "Option Explicit" at the very top of
every Module, and start declaring (may be too much work, but might be
worth it?)

I did another google search, and I don't see anything for free ... I
bet that one of the experts will have something, though :)

Chris- Hide quoted text -

- Show quoted text -

Hi,

Not sure exactly what you need to achieve, but within the VBA
environment, you could try upening the 'Locals' window. Head for
'View' -> 'Locals'. Once this is visible, step through your code and
all the active variables will be listed with their values and types.
Might help you.

Cheers,
Ivan.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top