ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Passing Public Module Vairable to a Worksheet Event (https://www.excelbanter.com/excel-programming/315747-passing-public-module-vairable-worksheet-event.html)

SMS - John Howard

Passing Public Module Vairable to a Worksheet Event
 
Can any tell me how to pass a module declared variable toa worksheet event.
In this instance a Before Double Click event

TIA

John Howard
Sydney, Australia



AA2e72E

Passing Public Module Vairable to a Worksheet Event
 
This is an example:

1. Insert a module and declare a variable

Public Const xx = 100

2. In your Sheet module, the event is:

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
MsgBox Module1.xx
End Sub

The MsgBox line prefixes the reference to the variable xx by the module
name. If you have only one module, the prefix is unnecessary although its
presence may be helpful in debugging.

"SMS - John Howard" wrote:

Can any tell me how to pass a module declared variable toa worksheet event.
In this instance a Before Double Click event

TIA

John Howard
Sydney, Australia





All times are GMT +1. The time now is 02:59 AM.

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