V
Valeria
Dear experts,
I have a VBA code in workbook "A" that writes VBA code in workbook "B".
The code looks like:
With ActiveWorkbook.VBProject.VBComponents("Sheet4").CodeModule
StartLine = .CreateEventProc("Change", "Worksheet") + 1
.InsertLines StartLine, _
Etc.
It works on putting the code in Sheet4, but as Sheet4 is a created worksheet
by another macro, it is not always the sheet where I want the code!
Is there a way that I can tell VBA to put the code in the sheet called
"Data" instead than on Sheet4?
Thank you very much for your help.
Best regards
Valeria
I have a VBA code in workbook "A" that writes VBA code in workbook "B".
The code looks like:
With ActiveWorkbook.VBProject.VBComponents("Sheet4").CodeModule
StartLine = .CreateEventProc("Change", "Worksheet") + 1
.InsertLines StartLine, _
Etc.
It works on putting the code in Sheet4, but as Sheet4 is a created worksheet
by another macro, it is not always the sheet where I want the code!
Is there a way that I can tell VBA to put the code in the sheet called
"Data" instead than on Sheet4?
Thank you very much for your help.
Best regards
Valeria