Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 128
Default Values of Variable after Project has Run

Hi

Is it possible to check the values of all the public variables after the
subs have run. These are public and module declared variables. As I
understand it, the Locals window is not of any help

I can think of way of "cobbling" something together but wondered if anyone
has something almost "ready to go"

I realise the procedure may need to be called for each variable.

Thanks

Tim


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Values of Variable after Project has Run

You can add a "Watch" on public variable. You have to set up each Watch
individually -- you can't say "Watch All Globals"

Suppose you have code like

Public Y As Long
Public X As Long

Sub AAA()
X = 123
Y = 321
End Sub

Sub BBB()
X = 333
Y = 444
End Sub

In VBA, go to the Debug menu, choose "Add Watch", enter the variable name in
the "Expression" box, choose "(All Procedures)" in the Procedure box, choose
"(All Modules)" in the modules dropdown, and choose "Watch Expression" in
the Watch Type frame. Repeat this procedure for each variable you want to
watch. It will show you the value of the variables even after a procedure is
finished.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
(email address is on the web site)



"Tim Childs" wrote in message
...
Hi

Is it possible to check the values of all the public variables after the
subs have run. These are public and module declared variables. As I
understand it, the Locals window is not of any help

I can think of way of "cobbling" something together but wondered if anyone
has something almost "ready to go"

I realise the procedure may need to be called for each variable.

Thanks

Tim




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 128
Default Values of Variable after Project has Run

Hi Chip, Tom

Many thanks for those solutions

Tim


"Tom Ogilvy" wrote in message
...
assume you have a public variable name

MyVar

make the immediate window visible (and the project with the variable the
active project) and in the immediate window do

? MyVar

--
Regards,
Tom Ogilvy


"Tim Childs" wrote:

Hi

Is it possible to check the values of all the public variables after the
subs have run. These are public and module declared variables. As I
understand it, the Locals window is not of any help

I can think of way of "cobbling" something together but wondered if

anyone
has something almost "ready to go"

I realise the procedure may need to be called for each variable.

Thanks

Tim





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Exporting MS Project Values into Excel Paul Peterson - Velox Consulting, LLC Excel Worksheet Functions 2 October 13th 08 06:55 PM
Project values? panda Excel Worksheet Functions 6 March 12th 08 04:31 PM
Compile Error: Expected Variable or Procedure, Not Project BEEJAY Excel Programming 7 November 6th 06 08:40 PM
How can I project the values of intersection of curves in chart on RahulMani Excel Worksheet Functions 1 June 5th 06 04:00 PM
project values based on other values Gabriele Excel Discussion (Misc queries) 1 January 7th 05 09:27 AM


All times are GMT +1. The time now is 05:39 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"