Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Variable in event handles can't be used in module??
This must be simple but I was unable to find how to do.
In the event handler I use a variable ----------------------------------------------------- Option Explicit Public var1 As String Dim status As String ----------------------------------------------------- Private Sub Worksheet_BeforerightClick(ByVal Target _ As Excel.Range, Cancel As Boolean) If Target.Column < 22 Then Exit Sub If Target.row < 5 Then Exit Sub If ActiveCell.Value = "" Then ActiveCell.Value = "1" status = "1" End If Var1 = Worksheets("maandag").Cells(Target.row, 28) Check_status End Sub In the module it goes like: Sub Check_status() MsgBox var1 End Sub Problem is that the var1 is not present in the module, can someone help me... Thanks in advance Jan Grinwis |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Variable in event handles can't be used in module??
Assume that Var1 is declared in the sheet module for sheet1 (codename
sheet1) Sub Check_status() MsgBox sheet1.var1 End Sub -- Regards, Tom Ogilvy "Jan Grinwis" wrote in message om... This must be simple but I was unable to find how to do. In the event handler I use a variable ----------------------------------------------------- Option Explicit Public var1 As String Dim status As String ----------------------------------------------------- Private Sub Worksheet_BeforerightClick(ByVal Target _ As Excel.Range, Cancel As Boolean) If Target.Column < 22 Then Exit Sub If Target.row < 5 Then Exit Sub If ActiveCell.Value = "" Then ActiveCell.Value = "1" status = "1" End If Var1 = Worksheets("maandag").Cells(Target.row, 28) Check_status End Sub In the module it goes like: Sub Check_status() MsgBox var1 End Sub Problem is that the var1 is not present in the module, can someone help me... Thanks in advance Jan Grinwis |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Where?Worksheet code module or Worksheet_SelectionChange event han | Excel Worksheet Functions | |||
Handling of event raised in other class module | Excel Programming | |||
Run module ON OPEN event?? | Excel Programming | |||
Which event puts *white* handles around a chart? | Excel Programming | |||
Variable from a sheet module in a class module in XL XP | Excel Programming |