Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Excel: Deleting Macros and Functions

Sir Chip,

Thank you for the rapid response. Regreatfully, when I
visit the URL you provided all I get is a nice header
and...

<table border="0" wid

I'll try again later.
Again, may I extend my appreciation for your support?

Earle, Data Troll


-----Original Message-----
Earle,

See the "Deleting All VBA Code In A Project" section at
http://www.cpearson.com/excel/vbe.htm .


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"Earle" wrote in message
...
Greetings,

Does anyone have macro/VBA code that will find all

Macros
and all user-added Functions, and delete them enmasse?

This code does pass the Compile test, but always returns
Zero as Help says the various properties/methods
of .Modules is hidden and not available:
Dim intVBA As Integer
intVBA = ActiveWorkbook.Modules.Count

I find it a royal pain in the mouse to have to delete
Macros and user-Functions one at a time. These are all
preparation/formatting/processing macros/functions and

are
not needed once the workbook is in the hands of users.

And it would be really neat if the KillMacros macro

would
delete itself as the last thing it does.

Regards to All



.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excel: Deleting Macros and Functions

Hi Earle.

Here's the code that Chip references:

Deleting All VBA Code In A Project

The procedure below will delete all the VBA code in a project. You should
use this procedure with care, as it will permanently delete the code.
Standard modules, user forms, and class modules will be removed, and code
within the ThisWorkbook module and the sheet modules will be deleted. You
may want to export the VBA code, using the procedure above, before deleting
the VBA code.

Sub DeleteAllVBA()

Dim VBComp As VBIDE.VBComponent
Dim VBComps As VBIDE.VBComponents

Set VBComps = ActiveWorkbook.VBProject.VBComponents

For Each VBComp In VBComps
Select Case VBComp.Type
Case vbext_ct_StdModule, vbext_ct_MSForm, _
vbext_ct_ClassModule
VBComps.Remove VBComp
Case Else
With VBComp.CodeModule
.DeleteLines 1, .CountOfLines
End With
End Select
Next VBComp

End Sub

Sincerely,

Rita Nikas, MCSE MCDBA
Product Support Services
Microsoft Corporation

This posting is provided "AS IS" with no warranties, and confers no rights.


--------------------
| Subject: Excel: Deleting Macros and Functions
| Date: Tue, 8 Jul 2003 06:31:19 -0700
|
| Sir Chip,
|
| Thank you for the rapid response. Regreatfully, when I
| visit the URL you provided all I get is a nice header
| and...
|
| <table border="0" wid
|
| I'll try again later.
| Again, may I extend my appreciation for your support?
|
| Earle, Data Troll
|
|
| -----Original Message-----
| Earle,
|
| See the "Deleting All VBA Code In A Project" section at
| http://www.cpearson.com/excel/vbe.htm .
|
|
| --
| Cordially,
| Chip Pearson
| Microsoft MVP - Excel
| Pearson Software Consulting, LLC
| www.cpearson.com
|
|
|
| "Earle" wrote in message
| ...
| Greetings,
|
| Does anyone have macro/VBA code that will find all
| Macros
| and all user-added Functions, and delete them enmasse?
|
| This code does pass the Compile test, but always returns
| Zero as Help says the various properties/methods
| of .Modules is hidden and not available:
| Dim intVBA As Integer
| intVBA = ActiveWorkbook.Modules.Count
|
| I find it a royal pain in the mouse to have to delete
| Macros and user-Functions one at a time. These are all
| preparation/formatting/processing macros/functions and
| are
| not needed once the workbook is in the hands of users.
|
| And it would be really neat if the KillMacros macro
| would
| delete itself as the last thing it does.
|
| Regards to All
|
|
| .
|
|

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
Excel (2002) slow after deleting some macros Peter[_14_] Excel Discussion (Misc queries) 0 April 18th 10 09:06 PM
Deleting Macros Larry Ebinger Excel Discussion (Misc queries) 3 December 9th 06 05:05 AM
How to hide a macros/functions from excel sheets Bepenfriends Excel Discussion (Misc queries) 1 December 5th 06 07:50 PM
Excel Functions and Macros Rich Excel Discussion (Misc queries) 2 December 22nd 05 04:55 PM
Shortcut keys assigned to macros/functions in excel Aussie CPA Excel Worksheet Functions 8 September 13th 05 02:49 AM


All times are GMT +1. The time now is 08:53 PM.

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"