View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Rob van Gelder[_4_] Rob van Gelder[_4_] is offline
external usenet poster
 
Posts: 1,236
Default Use VB code to remove code in sheet1

Jeff,

Sub test()
Dim strCodeName As String

strCodeName = Worksheets("My Sheet 1").CodeName
With ThisWorkbook.VBProject.VBComponents(strCodeName).C odeModule
If .CountOfLines 0 Then .DeleteLines 1, .CountOfLines
End With
End Sub

You could have problems running this under Excel 2002 with the security
features. Recommend investigating 'trusted code' options if this is a
problem.

Rob


"WashoeJeff" wrote in message
...
I can't seem to find anything that works to remove code from Sheet1 or for
that matter any modules

I have a procedure and am going to send the finished sheet but want to

strip
the code with a routine I followed instructions in a book but it doesnt

seem
to work.
Any help appreciated
Jeff




-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----