ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How do I pass a value from an event back to my VBA Programming enviornment. (https://www.excelbanter.com/excel-programming/417382-how-do-i-pass-value-event-back-my-vba-programming-enviornment.html)

Mac Lingo

How do I pass a value from an event back to my VBA Programming enviornment.
 
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



FSt1

How do I pass a value from an event back to my VBA Programming env
 
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.

"Mac Lingo" wrote:

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




Duncan[_7_]

How do I pass a value from an event back to my VBA Programmingenviornment.
 
On 21 Sep, 03:35, "Mac Lingo" wrote:
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.


All times are GMT +1. The time now is 08:35 AM.

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