VBProj.VBComponents

  • Thread starter Thread starter Tim Rush
  • Start date Start date
T

Tim Rush

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!
 
Set VBComp = VBProj.VBComponents(worksheets("Somesheetnamehere").codename)

or

Set CodeMod _
= VBProj.VBComponents(worksheets("Somesheetnamehere").codename).codemodule
 
Thanks! Not at work at the moment, but when I get in tomorrow will
definitely use it. It makes sense now that I see it.
 
Yep, that did it for me. Thanks!!!
I just posted another question using this routine, but its not related to
this one so thought a new thread would be better.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top