Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

deletion macro through macro

Forum home » Delegate support and help forum » Microsoft Excel VBA Training and help » Deletion of macro through a macro in Excel

Deletion of macro through a macro in Excel

ResolvedVersion 2003

Rahela has attended:
Excel VBA Intro Intermediate course

Deletion of macro through a macro in Excel

Hello,

How do we delete/remove a macro which already exist in the output file(it is nothing but just the formatting of input file and placing in some other folder, thus the input file contains some macro which needs to be deleted while showing it as output file) generated through a macro written in other excel file?

RE: Deletion of macro through a macro in Excel

Hi Rahela, thanks for your query. First of all, here are a couple of links which contain code to answer your question:

http://excel.tips.net/Pages/T003073_Deleting_Macros_from_within_a_Macro.html

http://www.pcreview.co.uk/forums/thread-1005665.php

However, I think we talked about this and if I remember correctly, you wanted to create some code to generate workbooks containing specific worksheets from a master workbook. Have you created a macro to do this and, if so, do you child workbooks contain macros? Hence your query? If you create code to copy out worksheets into a new workbook, those new child workbooks shouldn't contain any macros in them, so I'm intrigued about the code you need to delete. I hope the above links help, but if you need further assistance just let me know.

Hope this helps,

Anthony

 

Training courses

Training information:

Welcome. Please choose your application (eg. Excel) and then post your question.

Our Microsoft Qualified trainers will then respond within 24 hours (working days).

Frequently Asked Questions
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.

Excel tip:

Use RANDBETWEEN to generate random numbers

There may be occassions where you need to generate random numbers in your spreadsheet. Use the RANDBETWEEN function to generate random numbers between two values that you specify.

The function looks like this:

=randbetween(LOW,HIGH)

where LOW is the lowest number you want generated; and HIGH is the highest number you want generated.

This formula will work with both positive and negative LOWs and HIGHs. Also it will only generate integer numbers unless forced to do otherwise by the following:

=randbetween(LOW*10^PRECISION,
HIGH*10^PRECISION)/(10^PRECISION).

where PRECISION represents the levels of decimal precision needed (i.e. if you need numbers with one decimal place, PRECISION would be 1; 2 for two decimal places and so on).

One final note, if the RANDBETWEEN formula does not work in your spreadsheet or returns a "#NAME" error, you need to install the Analysis Toolpak Add-In. You will need to press F2 then Enter following the installation.

View all Excel hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.09 secs.