How do I pass a value from an event back to my VBA Programming enviornment.

  • Thread starter Thread starter Mac Lingo
  • Start date Start date
M

Mac Lingo

And can involk events, and they return the right variables while the event
is "running".

But I can't figure out how to return a variable an event to my ordinary VBA
code.
It should be so obvious (but it isn't to me).

Tnx,
Mac
 
hi
post your event code and your ordinary vba code.

Regards
FSt1
p.s. events are not code. events are what triggers the ordinary vba code to
run.
 
And can involk events, and they return the right variables while the event
is "running".

But I can't figure out how to return a variable an event to my ordinary VBA
code.
It should be so obvious (but it isn't to me).

Tnx,
Mac

If I understand correctly you are putting values in variables within
the event procedure but they aren't there in other procedures?

Go to the Declarations area and dimension the variables you need there
(eg Public Banana as Single). Once you set values in an event
procedure they will be available in any other procedure within the
same sheet or form. You can also add a 'module', dimension the
variables there and they will be available everywhere.

If that is what you mean.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top