给sheet2写个宏
Sub 写入宏()
With ActiveWorkbook.VBProject.VBComponents(3).CodeModule
.InsertLines 1, "Sub test()"
.InsertLines 2, " msgbox ""hello, How do you do!"""
.InsertLines 3, "End Sub"
End With
End Sub
给sheet2写个宏
Sub 写入宏()
With ActiveWorkbook.VBProject.VBComponents(3).CodeModule
.InsertLines 1, "Sub test()"
.InsertLines 2, " msgbox ""hello, How do you do!"""
.InsertLines 3, "End Sub"
End With
End Sub
也可这样写
Sub 写入宏()
With ActiveWorkbook.VBProject.VBComponents("Sheet2").CodeModule
.InsertLines 1, "Sub test()"
.InsertLines 2, " msgbox ""hello, How do you do!"""
.InsertLines 3, "End Sub"
End With
End Sub