Public Variable gone

Ricardo Caicedo

New Member
Joined
Aug 21, 2014
Messages
43
Good Morning guys

I have a problem with a Public Variable. I declare a PUBLIC WaveN as Integer in a general module, so I suppose the amount should be keep it all the time during the running.

The program UpdateMaster assign to the public variable WaveN a number after go through many rows (inside of this module), but then the following program TransferInfo needs that value. I got "on" the debug mode and I can see that as soon the first sub close the value just gone.

My code is follow:</SPAN>
Sub RunProgram()</SPAN>

Call UpdateMaster
Call TransferInfo
Call RangeLookFill
Call SplitInfo
Call UpdateFinal</SPAN>
End Sub</SPAN>


Any Ideas....do I have to put the UpdateMaster(WaveN) format?
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
Is there an End statement somewhere in the code?
 
Upvote 0
Good morning shg. I got and end select for error handling but i think this one is not creating the problem.

The code is large, but I can see in debug mode that before the "end sub" of this module, the vatiable keeps the value, but as soon close the module the variable get <out of context> so the value is gone.
 
Upvote 0
I found that it works if you declares public in a separate module and also the debug program shows the wrong information as the variable keeps the value through all the execution, but it shows as 'Out of context".

Thank you for your help
 
Upvote 0

Forum statistics

Threads
1,214,620
Messages
6,120,554
Members
448,970
Latest member
kennimack

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top