Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi AA2e72E,
You can do: Sub Form_Load() Set xl = CreateObject("Excel.Application") Set wbk = xl.Workbooks.Add Set cmd = wbk.VBProject.VBComponents(wbk.Sheets(1).Name).Cod eModule With cmd ..InsertLines .CountOfLines + 1, "Private Sub Worksheet_Selection" _ & "Change(ByVal Target As Range)" ..InsertLines .CountOfLines + 1, "Call Newx" ..InsertLines .CountOfLines + 1, "End Sub" ..InsertLines .CountOfLines + 1, "" ..InsertLines .CountOfLines + 1, "Sub Newx" ..InsertLines .CountOfLines + 1, "MsgBox ""Hello !"", 64" ..InsertLines .CountOfLines + 1, "End Sub" End With xl.Visible = True End Sub Regards, MP "AA2e72E" a écrit dans le message de ... In Visual Basic, how do I code this statement, xl.SheetSelectionChange = "Newx" to trap the selection change event ? Private Sub Form_Load() Set xl = CreateObject("Excel.Application") xl.Workbooks.Add xl.SheetSelection.Change = "Newx" xl.Cells(1, 4).Select End Sub Sub Newx() ' ... code End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
events? | Excel Discussion (Misc queries) | |||
Is there a way to turn events on or off? | Excel Programming | |||
events | Excel Programming | |||
events | Excel Programming | |||
Workbook Events | Excel Programming |