View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default VBProj.VBComponents

Set VBComp = VBProj.VBComponents(worksheets("Somesheetnamehere" ).codename)

or

Set CodeMod _
= VBProj.VBComponents(worksheets("Somesheetnamehere" ).codename).codemodule





Tim Rush wrote:

Using http://www.cpearson.com/excel/vbe.aspx
The line Set VBComp = VBProj.VBComponents(module)
expects a module name such as "sheet1" or "sheet2", which is nice if you
know which sheet it is. Can we reference the VBComponents by the sheet name
instead? Such as for sheet2(MySheet) I want to use MySheet, since it is not
always sheet2.
Thanks!


--

Dave Peterson