Hi Tom, sorry i am back, i changed the code to the following and then
excel closes due to an encounted error ?!! It puts in the the following
with no errors.
Private Sub Worksheet_Change(ByVal Target As Range)
End Sub
But then bombs out !!
My code is as follows.
Sub InsertProc()
Dim StartLine As Long
sname = ActiveSheet.CodeName
With ActiveWorkbook.VBProject.VBComponents(sname).CodeModule
StartLine = .CreateEventProc("Change", "Worksheet")
.InsertLines 1, "Dim VRange As Range"
.InsertLines 2, "VRange = ActiveSheet.Columns(""H:H"")"
.InsertLines 3, "Target.Interior.ColorIndex = 37"
.InsertLines 4, "Target.Interior.Pattern = xlSolid"
End With
End Sub
Les Stout