ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   VBA reseting variables (https://www.excelbanter.com/excel-discussion-misc-queries/69576-vba-reseting-variables.html)

Jeff

VBA reseting variables
 
Hi,

I have a Module with about 10 seperate macros? I mean these -- "Sub
Macros()"
I have declared variables at the top of the module so that each macro can
use the variable that is reset periodically in other macros. Then I have
this combobox that calls a Main macro that calls the macros and basically
calculates a fund.

The problem is that when I run the macro, (and the values of the fund are
print out on a sheet in the workbook), and then run it again, the values
change. So I am assuming that some of the variables are not being reset or
"hold onto" their previous value. The fund should not change because I am
running the same values.

Does anyone have any advice if the variables are not being reset, or if
there is a way to automatically reset the variables?

i would appreciate any help on this thanke


All times are GMT +1. The time now is 08:18 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com