Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default VBProj.VBComponents

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!

  #2   Report Post  
Posted to microsoft.public.excel.programming
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
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default VBProj.VBComponents

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.

"Dave Peterson" wrote:

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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default VBProj.VBComponents

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.

"Dave Peterson" wrote:

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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Security and working with VBComponents Keithlo Excel Programming 2 October 10th 06 10:13 PM
VBComponents question Frederick Chow Excel Programming 2 March 20th 06 07:18 PM
Links between VBComponents and Sheets 3 Paul Excel Programming 1 August 5th 04 04:38 PM
Links between VBComponents and Sheets 2 Paul Excel Programming 1 August 5th 04 04:59 AM
Links between VBcomponents and Sheets Bernie Deitrick Excel Programming 1 August 4th 04 07:19 PM


All times are GMT +1. The time now is 02:39 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"