Hi,

I have a form that creates custom sheets dynamically as the user needs them. The problem that I have is that I need to add two sub procedures associated with each sheet, BeforeDoubleClick and SelectionChange.
When the form creates the sheet I need it to add the following code as well:

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Call sheetDoubleClick("Day")
End Sub


Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If IsEmpty(ActiveCell) <> True Or ActiveCell.Column <> "3" Then
Range("C" & ActiveCell.Row).Select
End If
End Sub

How would I do this from a macro??

Any help would be great

Ben