Free Microsoft Excel 2013 Quick Reference

Remove macro Results


the redoubtable DP (very helpfully) gave me this code to remove all
the buttons from a spreadsheet. In reality I want to restrict the
removal to buttons in Column A only. (there are 100+). Alternatively,
I want to remove all the buttons except for one in Column C. It may
sound odd but it is true!

Please can someone give me a start on revising the code



Set CurWks = ActiveSheet

With CurWks
'Suppressed as it deletes the clear clipboard button

Hi there,

We are facing one problem from around 2 months.Some of our users have
XF_SIC.A virus found in their pc.XF_SIC.A virus generally found in excel
workbook as macro virus.This virus create one excel 4.0 macro sheet with
"very hidden and very protected" attributes in excel 97 workbooks which can't
be removed as it is not seen.every time when infected excel 97 file opens it
infect the default startup excel file(Book1 placed in XLSTART folder) and
then every excel file that will be open will have infection as default file
book1 our antivirus software mcafee can clean XF_SIC.A but it
can't remove that excel 4.0 macro from excel workbook so every time after
cleaning of virus,when that excel file open again problem start.We had tried
with various antivirus softwares but the problem remains same.During search,
we found that there are some tools available named as "macro remover" that
are able to remove macro 4.0 from excel 97 workbook. I want to know if such
tools available at free of cost or not.I am in need of your suggestions and
sachin shah
exchange system administrator
ashima group,india

Hello all. I am looking for some vba to save a worksheet minus the macros. All formatting would have to be maintained while removing the macros. I have 2 macros (modules) and code within the sheet itself (object). If that makes any sense. I guess the ultimate solution would be to remove all vba from the project itself. Can anyone point me to a solution or provide some guidance.

Thank you,


hi there,
I am working on someone else's spreadsheet which has a new pull-down menu
with the print function on it which enables printing of all worksheets
simultaneously. How do I remove it? I have tried going to Tools, Macro,
Macros but when I click on the macro name (print), the delete function does
not light up. So how do I delete this?

Please assist.

I have saved as a workbook and made some amendments in it to use for some other purpose. when I open that new workbook it sometimes gives a message that macro cannot be run because of security level (explaining message in my own words) but this do not happen each time when I open that book.
I have not created any macro in that workbook (so far as I remember).

I have seen in window of macros (Alt+F8) there is no macro in that window.
what's that mystery. how can I find and remove macro.

I have my macros all done up doing exactly what I want. I have run into 2 problems however.

When I have it set to save a file, if the filename already exists, it asks if I wish to overwrite, if I say yes, it continues on fine, if I say no, the macro stops and crashes, saying

"Run-time error '1004'
Method 'SaveAs' of object '_Workbook' failed

Is there a way if I say no for it to continue on instead of crashing?

The other problem I have is when I send out reports that I used macros to create. I just want people to be able to view the reports of the data, but instead a box comes up when they try to open them saying that the file contains macros, and that "Macros may contain viruses, it is usually safe to disable macros". Is there anyway of automatically removing any macros from a file before it sends?

Any help would be great!,


I am somewhat new to Excel programming, so the question may be somewhat basic. please bare with me...

I have a macro which performs certain task without any problems. At the end of the operation I copy all of the information from the worksheet which contains the macro to a different worksheet (actually csv file). However somehow the "button/graphic/shape" I assigned the macro to, copies as well and I don't want that to happen.

How do I remove it?


TO copy I do this:

Worksheets("Sheet1").Range("A:Z").Copy Destination:=Workbooks("test.csv").Worksheets("Sheet1").Range("A:Z")

I had a startup macro in my XLS file and removed it. But each time I
open this document, a message pops ups saying the macros are disabled
for security reasons. How can I stop it from poping up?

I have this file. I will be constructing a new file using some data and formats from the old one so I decided to work OVER it. I have trimmed it down and its almost ready but I know the old one had macro's in it and when I open it, it also says something like: "Some cells in this workbook are using data from other workbooks, would you like to update the data?"

1. I would not like surprises (mainly because I didn't track the macros to see what they are doing so they could be augmenting some data which I don't want to).
2. I would not like the managers to be clicking and deciding on to whether to run macros and/or update data - especially when there's no need to. You know managers, calling a general assembly about everything

A) How do I find the macros and how do I find cells which use external data?
B) What's the most elegant way of deleting them?


After removing macros by deleting in the Tools/macro/macros... then delete
them some macros do not delete and the message Enable or Disable Macros comes
up every time the sheet is opened. Is there a way to remove these macros or
tell the Enable Disable window it is no longer applicable?

I would like to remove all code from my workbook/worksheet. How is this
The form I designed generates a security msg. and the endusers may not be
able or allowed to adjust their security settings... thanks

I have a spreadsheet that I originally created a couple of macras for, but
decided I no longer needed. I have deleted the macros and the buttons linked
to the macros, but I still get a message at start up asking me if I'd like to
enable macros. What can I do??

I am sending an excel workbook by email by a macro in the same excel.
Now obviously, its copy is emailed. But that copy will also contain
macro and all the buttons or controls I have added. Can I remove these
additional things and just send plain text excel containing only data?
Even if I can not remove buttons or any control I have added to current
workbook, it's OK. But I don't want my users to get into my code.

I have a macro I use at work that will save my workbook to a specific folder on a network drive using a value from a cell as the file name, that was the easy part. What I am having trouble with is the saved copies need to have all macros removed. The saved files get emailed to customers and cant have macros in them.(I dont have the code i am using available to post here at the moment.)

any help would be greatly appreciated.

So I currently have a spreadsheet which was a SAP/BW report export, and it is now coming up with a macro security question each time I open it. There aren't any macros in the file.

What can I do in the script editor to weed it out and try to get rid of this message?

I am trying to save a file from a macro enabled file into 'xlsx' format and automatically answer 'Yes' to the VB Project dialog box that comes up to warn about the removal of macros.

The object of the exercise is to save only the worksheet to the output file without any of the VB project files.

Saving the file as xlsx is easy enough with the normal VBA saveas routine but is there a way that I can automatically answer the VB Project warning dialog basic so that the dialog box does not appear and the output file save completes seamlessly like an ordinary save.


Due to the economy we are only scheduling days to work one week ahead which leads to alot of phone calls. The gaurds who get the calls then search thru a printed spreadsheet looking for a clock number or last name. I realized right away they should just look at the file on the computer and due edit - find. The problem is they due not use computers unless printing and they looked at me like I was talking in a different language. So I want to edit this macro below so it will allow user to type in search criteria instead of using same search criteria every time. Here it is 70039. I do not use macros or excel often so any help would be greatly appreciated. I also need to place a shortcut or button to this macro on the toolbar or sheet and do not know how. How do I stop "remove macro or enable when file is loaded"?

Sub Search()
' Search Macro
' Macro recorded 2/27/2009 by Carl Johnman
Selection.Find(What:="70039", After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
End Sub


I have a large workbook full of macros.
I need to be able to back up this workbook on close which is fine i can code that. However i need to stop others from using the macros if they open the backup file. Therefore i would like to know how to either disable macros or remove them when the file is closed.

The backup copy could just be the original copied and pasted into a new workbook and saved as the backup if that will remove the macro's.

The workbook can have upto twenty sheets in it when it is closed.
I've included my existing close macro below for info.

Thanks in advance for any help you can give.

Private Sub Workbook_BeforeClose(Cancel As Boolean)

Dim Msg As String
Dim ans As Integer
Dim FName As String

Msg = "Would you like to Clean up this workbook to save it as a smaller file thereby deleting all data? If not save it
as a copy with all data intact?"
ans = MsgBox(Msg, vbYesNo)
If ans = vbYes Then

    ThisWorkbook.Sheets("DO calc").Range("a1:b7").Clear
    ThisWorkbook.Sheets("DO calc").Range("a11:s65000").Clear
    ThisWorkbook.Sheets("Source calc").Range("a1:b7").Clear
    ThisWorkbook.Sheets("Source calc").Range("a11:aq65000").Clear
    ThisWorkbook.Sheets("Emergency Storage Calcs").Range("b5:ao5").Clear
    ThisWorkbook.Sheets("Plot Data").Range("a1:b7").Clear
    ThisWorkbook.Sheets("Plot Data").Range("a13:ao65000").Clear

                'Deletes extra sheets except originals

    Application.DisplayAlerts = False

    For Each ws In ActiveWorkbook.Sheets
        Debug.Print ws.Name

        If ws.Name <> "Notes" And _
           ws.Name <> "DO calc" And _
           ws.Name <> "Source calc" And _
           ws.Name <> "Emergency Storage Calcs" And _
           ws.Name <> "Licence Check" And _
           ws.Name <> "Plot Data" Then
       End If

    Next ws

    Application.DisplayAlerts = True
End If

End Sub

Hi I've recorded some macros but when i click on the button the screen 'flickers' as it runs the recorded macro. I know there is a way to remove this with some short code I just cannot rememeber how to do it?

Can anyone help with this?

Many thanks!!!


I have a worksheet that contains 1 macro to display the page and last saved date. I pressed ALT+F11 and removed the macro. The macro is removed but the text still shows up on the worksheet. Did I miss a step?

No luck finding an answer? You could always try Google.