LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 52
Default this is code that down excel

i need sheet code copy many sheets from a sheet except specific sheets
only, for example, sheet name is the Curr2, xCurr, Curr3. but ,
unhappinesly this code exit xl program.

Sub sbVBECopyEvnt(wb, sSrc)
Dim x As VBIDE.VBComponent
Dim codModul As VBIDE.CodeModule
With wb.VBProject
Set codModul = .VBComponents.Item(sSrc.CodeName).CodeModule
srCodSrc = codModul.Lines(1, codModul.CountOfLines)
For Each x In .VBComponents
If x.Type = vbext_ct_Document Then 'x.name==thisworkbook,
sheet2...
namSht = x.Properties("name")
If x.Name < "ThisWorkbook" And sSrc.CodeName < x.Name And _
CBool(InStr(1, namSht, "Curr")) = False Then
x.CodeModule.DeleteLines 1, x.CodeModule.CountOfLines
x.CodeModule.AddFromString srCodSrc
End If
End If
Next
End With
End Sub

Sub sbVBECopyEvnt_tst()
Call sbVBECopyEvnt(ActiveWorkbook, ActiveWorkbook.Sheets("01"))
End Sub

*** Sent via Developersdex http://www.developersdex.com ***
 
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
do anybody have a sample code for executing excel macro from vb code?<eom B Deepak Excel Programming 2 September 30th 05 09:59 AM
stubborn Excel crash when editing code with code, one solution Brian Murphy Excel Programming 0 February 20th 05 05:56 AM
Word VBA Code to Excel Code Lee Excel Programming 1 September 24th 04 04:03 AM
Excel XP VBA code to search all macro code in Excel module for specific search string criteria Ed[_18_] Excel Programming 4 May 20th 04 02:08 PM
Excel XP VBA code to search all macro code in Excel module for specific search string criteria Frank Kabel Excel Programming 0 May 19th 04 08:11 PM


All times are GMT +1. The time now is 09:23 AM.

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"