Hey guys,
I am somewhat competent at VBA coding so I am a little embarrassed by this problem: When I run a macro normally it works but then when I call it during an event macro a variable changes unexpectedly. The whole point of the event is to trigger after each data entry so that the interface is automated and therefore much cooler! Its not an issue with public variable declaration because the event macro uses mostly its own variable and the necessary variables from the other macro are public. My only thought is that during the regular macro data is entered into cells and that might trigger the event macro again but I'm not sure. I've even identified where it jumps by using message boxes but I don't have a clue why it jumps.
Here are the relevant parts of my event macro:
Here are the relevant parts of my regular macro ProceedStep2 which is where the error occurs:
The first message box checking the value of j reads 1 and the second reads 4, when it should be 1 because I have one account inputted. The variables are properly defined and have values set by the macro StoreAccounts. This is part of a complex project interface with about 25 different macros(~1500 lines total) so I don't think posting the whole thing would be a good idea. Also, I know the error has something to do with these parts due to the way I separated the macros. Again it works when I run manually but running by using the event macro causes "j" to jump to 4 for some reason. Please help!!!
Bookmarks