R
Rich Wallace
Hi all,
Curious on how to add code to a specific sheet within a workbook.
Currently, I can add a new module and then add code to that module by using
this:
oModule =
oBook.VBProject.VBComponents.Add(VBIDE.vbext_ComponentType.vbext_ct_StdModul
e)
sCode = "sub VBAMacro()" & vbCr & _
" msgbox ""VBA Macro called"" " & vbCr & _
"end sub"
oModule.CodeModule.AddFromString(sCode)
But is there a way I can place code into a sheet rather than to a module?
TIA
-Rich
Curious on how to add code to a specific sheet within a workbook.
Currently, I can add a new module and then add code to that module by using
this:
oModule =
oBook.VBProject.VBComponents.Add(VBIDE.vbext_ComponentType.vbext_ct_StdModul
e)
sCode = "sub VBAMacro()" & vbCr & _
" msgbox ""VBA Macro called"" " & vbCr & _
"end sub"
oModule.CodeModule.AddFromString(sCode)
But is there a way I can place code into a sheet rather than to a module?
TIA
-Rich