Delete all vba from excel

Is it possible to remove all VBA modules from an Excel file using VBA?

The names of the modules if they exist at all are unknowns before running this script.

Community's user avatar

asked Aug 29, 2013 at 18:30

user1283776's user avatar

user1283776user1283776

18.8k43 gold badges135 silver badges267 bronze badges

Obviously, you can. The following code will do the job:

Sub compact_code()

On Error Resume Next
    Dim Element As Object
    For Each Element In ActiveWorkbook.VBProject.VBComponents
        ActiveWorkbook.VBProject.VBComponents.Remove Element
    Next

End Sub

This will remove all modules including ClassModules and UserForms but keep all object modules (sheets, workbook).

answered Aug 29, 2013 at 18:47

Kazimierz Jawor's user avatar

Kazimierz JaworKazimierz Jawor

18.8k7 gold badges35 silver badges55 bronze badges

3

Here is a similar alternative that removes only the ClassModules:

On Error Resume Next
With wbk.VBProject
    For x = .VBComponents.Count To 1 Step -1
        If .VBComponents(x).Type = vbext_ct_StdModule Then
            .VBComponents.Remove .VBComponents(x)
        End If
    Next x
End With
On Error GoTo 0

answered Aug 29, 2013 at 19:00

user1283776's user avatar

user1283776user1283776

18.8k43 gold badges135 silver badges267 bronze badges

0

Содержание

  1. Remove VBA Code From a Workbook in Microsoft Excel
  2. How to Remove Macros From an Excel Workbook (3 Easy Ways)
  3. Remove All Macros by Saving the File in XLSX format
  4. Remove Specific Macros from the Macro dialog box
  5. Remove the Module that has the Macro
  6. Как удалить макросы из книги Excel (3 простых способа)
  7. Удалите все макросы, сохранив файл в формате XLSX
  8. Удалить определенные макросы из диалогового окна «Макрос»
  9. Удалите модуль с макросом

Remove VBA Code From a Workbook in Microsoft Excel

If you need to do this often, find out how to do it programmatically (using VBA to remove VBA).

But if you’re no coder, like I’m no coder, you can do it manually, like this:

  1. Hit Alt+F11 or Tools Macro Visual Basic Editor to open the VBE. If your window doesn’t look somewhat like the graphic below, go to the View menu and choose each of the following: Code, Project Explorer, Properties Window. (I don’t show the entire window, but most of it.)

If you only have one workbook open, it’ll be the VBAProject(WorkbookName) in the Project Explorer window. In this case, I am using Book1.

Double-click each sheet tab, and make sure there’s no code in the window at right-NONE. You can click in the code window and hit Ctrl+A and then hit your Delete key.

Double-click ThisWorkbook, and make sure there’s no code in the code window.

You may also have something called a Module and your Project Explorer window will look more like the one below. Right-click any modules and choose Remove. If you want to completely delete the code, you can say NO when asked if you first want to export the module.

Your workbook should now be code-free and you shouldn’t get the macro warnings anymore.

Источник

How to Remove Macros From an Excel Workbook (3 Easy Ways)

Using VBA Macros in Excel can be a huge time saver. You can automate a lot of repetitive tasks and create new functions and functionalities in Excel with simple VBA macro codes.

But in some cases, you may want to remove all the macros from an Excel workbook (or delete specific macros only).

This may be the case when you get a workbook from someone else and you want to make it macro-free, or when you’re sending a file with macros to someone and the receipt doesn’t need these in the workbook.

In this tutorial, I will show you a couple of really simple ways to remove macros from a workbook in Microsoft Excel.

So let’s get started!

This Tutorial Covers:

Remove All Macros by Saving the File in XLSX format

If you want to get rid of all the macros at once, the easiest way to do this would be to save the existing workbook with the XLSX format.

By design, you can not have any VBA macro code in the XLSX file format. In case you do, it would be removed automatically while saving the Excel file.

With Excel, you can only have the macros in the .XLSM, .XLSB, and the older .XLS formats. When you save the workbook in any other format, the macros are immediately lost.

Suppose you have a file called Example.xlsm (with macros), below are the steps to remove all the macros from this file:

  1. Click the File tab
  2. Click on ‘Save As’ option (it’s ‘Save a Copy’ in new Excel versions)
  3. Click on Browse. This will open the Save As dialog box.
  4. In the Save As dialogue box, enter the name of the file with which you want to save it. You can also keep the existing name if you want
  5. Click on the Save As type drop-down
  6. Select the Excel Workbook (*.xlsx) option
  7. Click on Save
  8. In the prompt that appears, click on Yes. It’s just informing you that the VB Code will be lost if you save this file in the .XLSX format.

That’s it! Your file is now macro-free.

This method is great as it removes all the macros from the current Excel workbook in one go. However, if you want to remove some macros and delete some, this method will not work for you (see the one using the Macro dialog box for this).

Another good thing about this method is that you still have a copy of the original file that has all the macros (in case you need it in the future).

Remove Specific Macros from the Macro dialog box

While the previous method would delete all the macros. this one allows you to choose the ones that you want to be removed.

And in case you want to delete all the macros, you can do that as well.

Suppose you have a file called Example.xlsm that has some macros.

Below are the steps to delete a macro from this workbook:

  1. Click the Developer tab (in case you don’t see the Developer tab, see the note in yellow after the steps)
  2. Click on the Macros button. This will open the Macro dialogue box where you can see all the macros in the workbook
  3. In the ‘Macros in’ drop-down, make sure ‘This Workbook’ is selected.
  4. Select the macro name that you want to delete from the macro list
  5. Click on the Delete button. This will delete that selected macro

If you want to remove multiple (or all) macros, repeat steps 4 and 5.

Note: In case you don’t see the developer tab, click here to read on how to get the developer tab to show up in the ribbon in Excel. Alternatively, you can also use the keyboard shortcut – ALT + 8 to open the Macro dialog box.

Alternatively, you can also click on the Views tab, click on the Macros drop-down and then click on View Macros option. This will also open the Macros dialog box.

While this method works great, it would only allow you to remove macros that are stored in a module in the Visual Basic Editor. In case you have event macros (in specific worksheets or ThisWorkbook) or macros in the personal macro workbook, those can not be removed with this method.

Remove the Module that has the Macro

Another way to remove macros is to go to the Visual Basic Editor and remove macros from there.

This method gives you the most control as you can access all the macros (be it in the module or objects or personal macro workbook).

Below are the steps to delete a macro from the Visual Basic Editor:

  1. Click on the Developer tab in the ribbon
  2. Click on Visual Basic option (or use the keyboard shortcut – ALT + F11)
  3. In the VB Editor, you will have all the workbook objects in the Project Explorer. If you don’t see the Project Explorer, click on the View option in the menu and then click on Project Explorer
  4. In the Project Explorer, double click on the object that has the macro code. This could be a module, a worksheet object, or ThisWorkbook.
  5. In the code window that opens, delete the macros you want to remove. If you want to remove all, just select everything and hit the delete key.

In case you have a module that has the code that you want to remove, you can right-click on the module object and then click on Remove module option.

So these are three ways you can use to remove macros from a Microsoft Excel workbook.

I hope you found this tutorial useful!

Other Excel tutorials you may like:

Источник

Как удалить макросы из книги Excel (3 простых способа)

Использование макросов VBA в Excel может значительно сэкономить время. Вы можете автоматизировать множество повторяющихся задач и создавать новые функции и возможности в Excel с помощью простых кодов макросов VBA.

Но в некоторых случаях вам может потребоваться удалить все макросы из книги Excel (или удалить только определенные макросы).

Это может быть в том случае, если вы получаете книгу от кого-то другого и хотите освободить ее от макросов, или когда вы отправляете кому-то файл с макросами, а квитанция не нуждается в них в книге.

В этом уроке я покажу вам несколько действительно простых способов удалить макросы из книги в Microsoft Excel.

Удалите все макросы, сохранив файл в формате XLSX

Если вы хотите избавиться от всех макросов сразу, самый простой способ сделать это — сохранить существующую книгу в формате XLSX.

По умолчанию у вас не может быть кода макроса VBA в формате файла XLSX. Если вы это сделаете, он будет автоматически удален при сохранении файла Excel.

В Excel вы можете использовать макросы только в форматах .XLSM, .XLSB и более старых форматах .XLS. Когда вы сохраняете книгу в любом другом формате, макросы сразу теряются.

Предположим, у вас есть файл с именем Example.xlsm (с макросами), ниже приведены шаги по удалению всех макросов из этого файла:

  1. Перейдите на вкладку Файл.
  2. Нажмите на опцию «Сохранить как» (в новых версиях Excel это «Сохранить копию»).
  3. Щелкните Обзор. Откроется диалоговое окно «Сохранить как».
  4. В диалоговом окне «Сохранить как» введите имя файла, с которым вы хотите его сохранить. Вы также можете сохранить существующее имя, если хотите
  5. Щелкните раскрывающийся список Тип файла.
  6. Выберите вариант «Книга Excel (* .xlsx)».
  7. Нажмите на Сохранить
  8. В появившемся запросе нажмите Да. Он просто информирует вас о том, что код VB будет утерян, если вы сохраните этот файл в формате .XLSX.

Вот и все! Теперь ваш файл не содержит макросов.

Этот метод удобен тем, что удаляет все макросы из текущей книги Excel за один раз. Однако, если вы хотите удалить некоторые макросы и удалить некоторые, этот метод не сработает для вас (см. Тот, который использует диалоговое окно «Макрос» для этого).

Еще одна хорошая особенность этого метода заключается в том, что у вас все еще есть копия исходного файла со всеми макросами (на случай, если она вам понадобится в будущем).

Удалить определенные макросы из диалогового окна «Макрос»

Хотя предыдущий метод удалял все макросы. это позволяет вам выбрать те, которые вы хотите удалить.

И если вы хотите удалить все макросы, вы также можете это сделать.

Предположим, у вас есть файл с именем Example.xlsm, в котором есть несколько макросов.

Ниже приведены шаги по удалению макроса из этой книги:

  1. Перейдите на вкладку Разработчик (если вы не видите вкладку Разработчик, обратите внимание на примечание желтого цвета после шагов)
  2. Щелкните по кнопке Macros. Откроется диалоговое окно «Макрос», в котором вы увидите все макросы в книге.
  3. Убедитесь, что в раскрывающемся списке «Макросы в» выбрана «Эта книга».
  4. Выберите имя макроса, который вы хотите удалить, из списка макросов.
  5. Щелкните по кнопке Удалить. Это удалит выбранный макрос

Если вы хотите удалить несколько (или все) макросов, повторите шаги 4 и 5.

Примечание. Если вы не видите вкладку разработчика, нажмите здесь, чтобы узнать, как отобразить вкладку разработчика на ленте в Excel. Кроме того, вы также можете использовать сочетание клавиш — ALT + 8, чтобы открыть диалоговое окно «Макрос».

Кроме того, вы также можете щелкнуть вкладку «Представления», щелкнуть раскрывающийся список «Макросы» и затем выбрать опцию «Просмотр макросов». Это также откроет диалоговое окно Macros.

Хотя этот метод отлично работает, он позволяет удалять только макросы, которые хранятся в модуле редактора Visual Basic. Если у вас есть макросы событий (в определенных листах или ThisWorkbook) или макросы в личной книге макросов, их нельзя удалить с помощью этого метода.

Удалите модуль с макросом

Другой способ удалить макросы — перейти в редактор Visual Basic и удалить оттуда макросы.

Этот метод дает вам наибольший контроль, поскольку вы можете получить доступ ко всем макросам (будь то в модуле, объектах или личной книге макросов).

Ниже приведены шаги по удалению макроса из редактора Visual Basic:

  1. Щелкните вкладку Разработчик на ленте.
  2. Нажмите на опцию Visual Basic (или воспользуйтесь сочетанием клавиш — ALT + F11)
  3. В редакторе VB у вас будут все объекты книги в Project Explorer. Если вы не видите Project Explorer, выберите опцию View в меню, а затем нажмите Project Explorer.
  4. В Project Explorer дважды щелкните объект с кодом макроса. Это может быть модуль, объект рабочего листа или ThisWorkbook.
  5. В открывшемся окне кода удалите макросы, которые хотите удалить. Если вы хотите удалить все, просто выберите все и нажмите клавишу удаления.

Если у вас есть модуль, который имеет код, который вы хотите удалить, вы можете щелкнуть правой кнопкой мыши объект модуля, а затем выбрать опцию «Удалить модуль».

Итак, это три способа удаления макросов из книги Microsoft Excel.

Источник

If you need to do this often, find out
how to do it
programmatically (using VBA to remove VBA).

But if you’re no coder, like I’m no coder, you can do it manually, like this:

  1. Hit Alt+F11 or Tools Macro Visual
    Basic Editor to open the VBE. If your window doesn’t look somewhat like the
    graphic below, go to the View menu and choose each of the following: Code,
    Project Explorer, Properties Window. (I don’t show the entire window, but most
    of it.)

  1. If you only have one workbook open, it’ll be the
    VBAProject(WorkbookName) in the Project Explorer window. In this case, I am
    using Book1.

  2. Double-click each sheet tab, and make sure there’s no code in
    the window at right-NONE. You can click in the code
    window and hit Ctrl+A and then hit your Delete key.

  3. Double-click ThisWorkbook, and make sure there’s no code in
    the code window.

  4. You may also have something called a Module and your Project
    Explorer window will look more like the one below. Right-click any modules and
    choose Remove. If you want to completely delete the code, you can say NO when
    asked if you first want to export the module.

Your workbook should now be code-free and you shouldn’t get the
macro warnings anymore.

 

Excel

Remove All VBA Code Programmatically

Ease of Use

Intermediate

Version tested with

2002 

Submitted by:

Jacob Hilderbrand

Description:

A method to use VBA code to remove all VBA code in a workbook. 

Discussion:

You have a lot of modules, userforms, and other code in a workbook and you want to delete it all at once. You could manually delete each one, one at a time, or you can use VBA to do all the work for you. 


Code:

instructions for use

			

Option Explicit Sub DeleteAllCode() Dim x As Integer Dim Proceed As VbMsgBoxResult Dim Prompt As String Dim Title As String Prompt = "Are you certain that you want to delete all the VBA Code from " & _ ActiveWorkbook.Name & "?" Title = "Verify Procedure" Proceed = MsgBox(Prompt, vbYesNo + vbQuestion, Title) If Proceed = vbNo Then MsgBox "Procedure Canceled", vbInformation, "Procedure Aborted" Exit Sub End If On Error Resume Next With ActiveWorkbook.VBProject For x = .VBComponents.Count To 1 Step -1 .VBComponents.Remove .VBComponents(x) Next x For x = .VBComponents.Count To 1 Step -1 .VBComponents(x).CodeModule.DeleteLines _ 1, .VBComponents(x).CodeModule.CountOfLines Next x End With On Error GoTo 0 End Sub

How to use:

  1. Open Excel.
  2. Press Alt + F11 to open VBE.
  3. Paste the code there.
  4. Close VBE (Alt + Q or press the X in the top right hand corner).
  5. Open the workbook that you want to remove all the code from.
  6. The VBA Project for that workbook must be unlocked (if it is protected).
  7. Trust Access To Visual Basics Project must be enabled.
  8. From Excel: Tools | Macro | Security | Trusted Sources.
  9. Tools | Macro | Macros (Select «DeleteAllCode» and press Run).

 

Test the code:

  1. Refer to the «How To Use» Section.
  2. Download the attachment for a working example.

 

Sample File:

DeleteAllCode.zip 7.81KB 

Approved by mdmackillop

This entry has been viewed 368 times.

  • #1

Hi guys,

I have been searching the internet for a code which will delete all vba. There are thousands of codes, yet, nothing works for me. could someone please assist me with a code that will do what I want done, please. I am using Excel 2013. All help will be greatly appreciated. Thank you all.

  • #2

Easiest way is to save the file as an .xlsx file.
That will remove all the code.

  • #3

if you want by code <you can make by this code

Code:

Option Explicit
 
Sub DeleteAllCode()
    
     'Trust Access To Visual Basics Project must be enabled.
     'From Excel: Tools | Macro | Security | Trusted Sources
    
    Dim x               As Integer
    Dim Proceed         As VbMsgBoxResult
    Dim Prompt          As String
    Dim Title           As String
    
    Prompt = "Are you certain that you want to delete all the VBA Code from " & _
    ActiveWorkbook.Name & "?"
    Title = "Verify Procedure"
    
    Proceed = MsgBox(Prompt, vbYesNo + vbQuestion, Title)
    If Proceed = vbNo Then
        MsgBox "Procedure Canceled", vbInformation, "Procedure Aborted"
        Exit Sub
    End If
    
    On Error Resume Next
    With ActiveWorkbook.VBProject
        For x = .VBComponents.Count To 1 Step -1
            .VBComponents.Remove .VBComponents(x)
        Next x
        For x = .VBComponents.Count To 1 Step -1
            .VBComponents(x).CodeModule.DeleteLines _
            1, .VBComponents(x).CodeModule.CountOfLines
        Next x
    End With
    On Error GoTo 0
    
End Sub

  • #4

Easiest way is to save the file as an .xlsx file.
That will remove all the code.

Hi Fluff13,

I did this, but then the workbook cannot be opened…file extension/format error..any way around this maybe?..thank you for your time..

  • #5

if you want by code <you can make by this code

Code:

Option Explicit

Sub DeleteAllCode()
   
     'Trust Access To Visual Basics Project must be enabled.
     'From Excel: Tools | Macro | Security | Trusted Sources
   
    Dim x               As Integer
    Dim Proceed         As VbMsgBoxResult
    Dim Prompt          As String
    Dim Title           As String
   
    Prompt = "Are you certain that you want to delete all the VBA Code from " & _
    ActiveWorkbook.Name & "?"
    Title = "Verify Procedure"
   
    Proceed = MsgBox(Prompt, vbYesNo + vbQuestion, Title)
    If Proceed = vbNo Then
        MsgBox "Procedure Canceled", vbInformation, "Procedure Aborted"
        Exit Sub
    End If
   
    On Error Resume Next
    With ActiveWorkbook.VBProject
        For x = .VBComponents.Count To 1 Step -1
            .VBComponents.Remove .VBComponents(x)
        Next x
        For x = .VBComponents.Count To 1 Step -1
            .VBComponents(x).CodeModule.DeleteLines _
            1, .VBComponents(x).CodeModule.CountOfLines
        Next x
    End With
    On Error GoTo 0
   
End Sub

Hello Herofox,

this is one of the codes I have tried…it works every other time..meaning….aftet the file is saved as xlsm, and I click the button to run the code, iteither execute or it doesn’t, and when it does not, you see the circle going on for and on…when it works, it executes in less that a second…but here it is…at the times when the code does not work…I open the vba editor to basically look at the code, then close the editor…and then it executes…I do not understand this…I have tried several other codes too, no luck…

  • #6

if you want by code <you can make by this code

Code:

Option Explicit

Sub DeleteAllCode()
   
     'Trust Access To Visual Basics Project must be enabled.
     'From Excel: Tools | Macro | Security | Trusted Sources
   
    Dim x               As Integer
    Dim Proceed         As VbMsgBoxResult
    Dim Prompt          As String
    Dim Title           As String
   
    Prompt = "Are you certain that you want to delete all the VBA Code from " & _
    ActiveWorkbook.Name & "?"
    Title = "Verify Procedure"
   
    Proceed = MsgBox(Prompt, vbYesNo + vbQuestion, Title)
    If Proceed = vbNo Then
        MsgBox "Procedure Canceled", vbInformation, "Procedure Aborted"
        Exit Sub
    End If
   
    On Error Resume Next
    With ActiveWorkbook.VBProject
        For x = .VBComponents.Count To 1 Step -1
            .VBComponents.Remove .VBComponents(x)
        Next x
        For x = .VBComponents.Count To 1 Step -1
            .VBComponents(x).CodeModule.DeleteLines _
            1, .VBComponents(x).CodeModule.CountOfLines
        Next x
    End With
    On Error GoTo 0
   
End Sub

herofox,

as expected..this code just circles…

  • #7

Hi Fluff13,

I did this, but then the workbook cannot be opened…file extension/format error..any way around this maybe?..thank you for your time..

Did you use «SaveAs» and select .xlsx as the file type?
If so you should have gotten a warning about «The following features cannot be saved…», at which point you click «Yes» to continue.

  • #8

Did you use «SaveAs» and select .xlsx as the file type?
If so you should have gotten a warning about «The following features cannot be saved…», at which point you click «Yes» to continue.

I use this code to do the saving:

Code:

ActiveWorkbook.SaveCopyAs "G:RIDGE GAMINGRIDGE TECHNICALSTOCK TAKE REPORTSTechnical Stock - .XLSM"

If I change the extension to XLSX, it copies and saves without a problem….but then I cannot open it..

  • #9

You cannot change the file type using SaveCopyAs, you have to use SaveAs
Like

Code:

Application.DisplayAlerts = False
ActiveWorkbook.SaveAs "G:RIDGE GAMINGRIDGE TECHNICALSTOCK TAKE REPORTSTechnical Stock - .XLSx", 51
Application.DisplayAlerts = True

  • #10

You cannot change the file type using SaveCopyAs, you have to use SaveAs
Like

Code:

Application.DisplayAlerts = False
ActiveWorkbook.SaveAs "G:RIDGE GAMINGRIDGE TECHNICALSTOCK TAKE REPORTSTechnical Stock - .XLSx", 51
Application.DisplayAlerts = True

I have copied and pasted your code as is…when I click the button, the button responds, but going to the folder, the file is not there. Maybe if I may just mention something…it is not really necessary for all the code to be deleted, the only reason I’m going this way is because I am not successful with just deleting a few lines in a sheet module either. If I could delete the first 4 lines of the sheet activation module, that would be perfect…

  • #11

Do you get any error messages?
As that code works for me.

  • #12

Do you get any error messages?
As that code works for me.

no error messages…what I did now was this:

I created a small file with an open code.. then inserted a button with your code above. Upon clicking I get a message saying this: You cannot save this type of file with the selected extension…and then it goes on to prompt I need to change it…..

So, Excel refuses to save it as xlsx.

with all other codes that I have tried, excel saves the file but I cannot open it…your code in my file, does nothing…I’m at the point of giving up…

a last resort for me would be to clear some lines in a sheet module…but with that I am also not successful…I really do not know anymore..

  • #13

In that case can you please supply a demo file, with the relevant code?

  • #14

In that case can you please supply a demo file, with the relevant code?

Fluff`13,

I’m not at work today…will send tomorrow. I am not sure the size of the file, hope I will be able to send as is..

  • #15

Ok, that’s fine.
If the file is too large, you can strip out the data & formulae as they shouldn’t make a difference.

  • #16

Hi !​

As a reminder, when the file type is present when using the SaveAs method​

the file extension can be omitted so just try without …​

But if the code is within the workbook to ‘save as’ you must first use SaveCopyAs keeping the original extension​

then open this copy then SaveAs to change the file type then delete the copy …​

  • #17

Marc L,

thank you, I am going to look at that….Thank you..

Last edited by a moderator: Sep 6, 2019

  • #18

Ok, that’s fine.
If the file is too large, you can strip out the data & formulae as they shouldn’t make a difference.

Fluff13,

I am going to try Marc L’s suggestion, however, I would first like to solve the current approach, it’s just easier…
so, having said that, I am sooo close now. I found this code:

Code:

With ThisWorkbook.VBProject.VBComponents("Sheet1")
.CodeModule.DeleteLines 1, .CodeModule.CountOfLines
End With

This works but only if I unprotect the sheet. So, I manually un-protect the sheet, run the code and it works.
I added an un-protect code line and now I get an error message saying, that the vbproject is protected…

I am looking for code that will unprotect the vbproject now…(sigh)..sorry to go back and forth with this…can you kindly help me?

  • #19

Juriemagic
As Fluff13 has written save the file as an .xlsx file.
>> Why do You want to use VBA if You want to delete code?
Try this way:

1) Open Your file which has VBA-code which You would like to delete
2) From menu … Select File > SaveAs…
3) Modify name if needed
4) Take care that format is .xlsx
5) Reply to further questions as needed that You can save it as .xlsx ( and same time all VBA-code will delete)

  • #20

Juriemagic
As Fluff13 has written save the file as an .xlsx file.
>> Why do You want to use VBA if You want to delete code?
Try this way:

1) Open Your file which has VBA-code which You would like to delete
2) From menu … Select File > SaveAs…
3) Modify name if needed
4) Take care that format is .xlsx
5) Reply to further questions as needed that You can save it as .xlsx ( and same time all VBA-code will delete)

vletm,

I was about to explain things a bit better. The first thing is that the ribbon is hidden, all «save», insert, delete functionalities are greyed out on the sheet tab menu. this to ensure that certain actions are complied with before the save button becomes active. So, the user cannot save as.

What I have decided was to remove the vbproject code. nobody needs to know that. anycase, I believe the guys are trustworthy enough not to mess with something they know absolutely nothing about. If they do, it will be to their detriment.

So, everything is working fine with the above code provided.

I want to thank everyone who assisted with this thread, but I think let me not waste anyone’s time on this anymore…

I DID need to delete code with code..with vbproject safety still intact..but I accept this is maybe not possible. Thanx again to everyone!!

  • #21

Glad you’ve sorted it & thanks for the feedback

  • #22

Juriemagic
Your I DID need to delete code with code..
… that sounds suicide of code.
You could do that with basic Excel menu … almost same as Save …
… the ribbon … I didn’t give ANY steps to use something like that!

Понравилась статья? Поделить с друзьями:
  • Delete all styles in word
  • Delete all rows in excel vba
  • Delete all references in word
  • Delete all names in excel
  • Delete all macros in word