Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'd like to add a Procedure to a Worksheet Module via VBA.
The problem is that the module already contains a procedure, so I need to learn how to add the procedure UNDER the existing procedure. Attached is the procedure I'd like to add. Thanks in advance. Sub addselectionchange() Dim StartLine As Long Dim VBCodeMod As CodeModule Dim DEPT3 As String Dim LINENUM As Integer Set VBCodeMod = ThisWorkbook.VBProject.VBComponents(Worksheets("Al l").CodeName).CodeModule With VBCodeMod StartLine = .CreateEventProc("SelectionChange", "Worksheet") + 1 .InsertLines StartLine, _ "lastAddress = Target.Address" End With End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
HOW TO CARRY A VAIABLE RESULTS FROM EXCEL SHEET PROCEDURE TO A MODULE | Excel Discussion (Misc queries) | |||
to call procedure in a worksheet in a module | Excel Discussion (Misc queries) | |||
programmatically open VBE and go to a specified procedure in target module? | Excel Programming | |||
Lines in a Module(Procedure) | Excel Programming |