Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default sharing variables between form and module code

I need to coordinate execution between code based in Modules (accessed by
button driven macros) and events within form based code. I've defined
several public variables for this purpose, but the form based code doesn't
seem to be able to see the variables defined as public in the module and vice
versa. I haven't found anything else to use other than maybe using some
cells in the spreadsheet for this purpose. Can someone tell me if there is
something I can use within VBA to do what I want?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default sharing variables between form and module code

Hi TimK, That's how I do it. Make a cell on a sheet in the workbook that
holds the code equal to the variable in the control's code. Then you can
assign a variable to that value in the cell and carry on.

"TimK" wrote:

I need to coordinate execution between code based in Modules (accessed by
button driven macros) and events within form based code. I've defined
several public variables for this purpose, but the form based code doesn't
seem to be able to see the variables defined as public in the module and vice
versa. I haven't found anything else to use other than maybe using some
cells in the spreadsheet for this purpose. Can someone tell me if there is
something I can use within VBA to do what I want?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,582
Default sharing variables between form and module code

An alternative approach that doesn't tie you to a particular worksheet:

http://peltiertech.com/Excel/PropertyProcedures.html

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"JLGWhiz" wrote in message
...
Hi TimK, That's how I do it. Make a cell on a sheet in the workbook that
holds the code equal to the variable in the control's code. Then you can
assign a variable to that value in the cell and carry on.

"TimK" wrote:

I need to coordinate execution between code based in Modules (accessed by
button driven macros) and events within form based code. I've defined
several public variables for this purpose, but the form based code
doesn't
seem to be able to see the variables defined as public in the module and
vice
versa. I haven't found anything else to use other than maybe using some
cells in the spreadsheet for this purpose. Can someone tell me if there
is
something I can use within VBA to do what I want?



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sharing Variables CWillis Excel Discussion (Misc queries) 2 June 6th 06 07:02 PM
make sharing module x taol Excel Programming 0 February 9th 06 01:22 AM
Design Best Practices: Form Control Code in Worksheet or Module Bing Excel Programming 2 December 23rd 04 02:31 PM
Sharing function in a module Julie Excel Programming 2 May 13th 04 06:04 PM
Updating form labels from code in a module news.verizon.net[_2_] Excel Programming 2 October 29th 03 04:03 AM


All times are GMT +1. The time now is 09:07 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"