Hi Everybody ,
Iam trying to assign a Worksheet_Change event programmatically while creating the sheet during runtime.The sheets will be created at runtime based on a value in array . So am trying to create a event for the sheet through macro.I tried with the following code to create a event .But when executed excel Crashes abruptly.
In my program the sheet will be created dynamically in the for Loop as below
For Each Value In Arr '
Worksheets.Add
ActiveSheet.Name = Value
LoadCode (Value)
Next Value
Following is the code which I use,
sheet As String refers to sheetname which comes as parameter from other method
Please help me resolve this issue.
Thanks in Advance
Bookmarks