I have the following code and keep getting "run-time error '9'. what am i doing wrong?
![]()
Please Login or Register to view this content.
I have the following code and keep getting "run-time error '9'. what am i doing wrong?
![]()
Please Login or Register to view this content.
Last edited by vlady; 07-02-2014 at 07:48 PM.
That's because once the activate event is over, the program loses the value of SB and M.
Then, in the subsequent Exit events, you're trying to refer to a object that hasn't been declared or defined.
It's call the scope of variables and procedures. It's worth a read.
However, the code can be simplified and the problems of scope are resolved.
![]()
Please Login or Register to view this content.
David
(*) Reputation points appreciated.
thanks for the code, however, I am still getting the same error. when I check the debugger, it stops on the 1st line:
txtSnowball.Text = Worksheets("Sheet1").Range("C31")Any ideas?
I just ran a sample on my machine and it worked.
In that case, the worksheet name must be wrong.
that was the problem. It works great now. I was using the sheet reference instead of the name "Balances".
I have another question for you... How can I format the textbox in "currency" format?
thanks again,
When you stuff the textbox, you have to use the Format Function.
And when you push it back, you will need to use![]()
Please Login or Register to view this content.
to strip out the currency sign.![]()
Please Login or Register to view this content.
Textboxes are just that. Text (or strings) and you have to treat them accordingly.
that worked great. thanks
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks