LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
al al is offline
external usenet poster
 
Posts: 363
Default Worksheet in VB COMPONENT

I'm using the following code to add an event procedure to a worksheets code.
Rather than having to refer to the worksheet
as "Sheet1", i would like to refer to the worksheet as its actual
name, which is 10. How could I do so? Thanks in advance. See
the following code where "SHEET1" is used.

Sub addactivate()
Dim StartLine As Long
With ActiveWorkbook.VBProject.VBComponents("SHEET1").Co deModule
StartLine = .CreateEventProc("Activate", "Worksheet") + 1
.InsertLines StartLine, _
"If lastAddress < """" Then Range(lastAddress).Select"
End With

End Sub

 
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
SUMPRODUCT with an OR component andy62 Excel Discussion (Misc queries) 5 June 11th 09 10:01 PM
Office web component . Ermias Excel Worksheet Functions 0 May 20th 08 11:40 PM
Web Excel Component Bug [email protected] Excel Discussion (Misc queries) 1 May 11th 07 12:22 AM
Changing VB Component Names to match Worksheet names using VBE Philip Excel Programming 1 April 12th 05 05:37 PM
Chart component Mika[_2_] Excel Programming 0 June 6th 04 04:23 PM


All times are GMT +1. The time now is 06:51 PM.

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

About Us

"It's about Microsoft Excel"