Hi All:
I have the following problem:
![]()
Please Login or Register to view this content.
![]()
Please Login or Register to view this content.
Thanks,![]()
Please Login or Register to view this content.
Yossi
Hi All:
I have the following problem:
![]()
Please Login or Register to view this content.
![]()
Please Login or Register to view this content.
Thanks,![]()
Please Login or Register to view this content.
Yossi
Last edited by arlu1201; 03-12-2013 at 01:32 PM.
The parameters you are passing to the subroutines are in single quotes and, therefore, being treated as comments. I couldn't actually get the code to run until I changed them to double quotes.
![]()
Please Login or Register to view this content.
HTML Code:
Regards, TMS
Trevor Shuttleworth - Retired Excel/VBA Consultant
I dream of a better world where chickens can cross the road without having their motives questioned
'Being unapologetic means never having to say you're sorry' John Cooper Clarke
Hi yossel and welcome to the forum,
Here is the best explanation about scope I've found.
http://www.cpearson.com/Excel/Scope.aspx
One test is worth a thousand opinions.
Click the * Add Reputation below to say thanks.
@MarvinP: that is quite comprehensive,isn't it!? Although I was/am aware of Public/Private variable, modules, etc., I don't think I've ever seen it explained so clearly. Now I want a reason to define "Casper the Friendly Object Module" ... got to admit, I got to about tw thirds of the way down and my head started spinning
Cheers, TMS
@TM Back in the old days of BASIC (1980's) we needed to keep track of these DIMed variables and how they were placed on the stack. I remember winning a codeing competition because I placed my most frequently used variable first in the DIM statements. Variables were searched for starting at the first one defined (per subroutine) until found. If you placed the DIM statement for that variable at the end of all the DIM statements it took extra time to find it. Simply placing the most frequently used variable at the front allowed it to be found first and my code ran a lot faster.
Global Dimed variables might be the answer to this OP question but it looks like s/he needs to determine where the variable is defined and how/if it is being addressed in the code.
yossel,
Welcome to the forum.
I have added code tags to your post. As per forum rule 3, you need to use them whenever you put any code in your post. Please add them in future. If you need more information on how to use them, check my signature below this post.
If I have helped, Don't forget to add to my reputation (click on the star below the post)
Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
Use code tags when posting your VBA code: [code] Your code here [/code]
Thanks a lot. My problem was that I was watching the 'Watch' window, expecting the value to change, not realizing that it was referencing the foo from sub1.
You're welcome. Thanks for the rep.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks