Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.
One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.
Sub RemoveVBAFiles() Dim pVBAProject As VBProject Dim vbComp As VBComponent Dim i As Integer Dim n As Integer ' Get the VBA project ' Set pVBAProject = ThisWorkbook.VBProject Set pVBAProject = Application.Workbooks("Oz_main.xls").VBProject n = pVBAProject.VBComponents.Count For i = n To 1 Step -1 Set vbComp = pVBAProject.VBComponents.Item(i) Select Case vbComp.Type Case vbext_ct_StdModule If vbComp.Name <> "Module1" Then pVBAProject.VBComponents.Remove pVBAProject.VBComponents.Item(i) End If Case Else If vbComp.Name <> "ThisWorkbook" And vbComp.Name <> "Sheet1" Then pVBAProject.VBComponents.Remove pVBAProject.VBComponents.Item(i) End If End Select Next MsgBox "Sheet has been cleared of all modules" End Sub
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
|VBA how to transform the data unmerging cells, deleting empty rows and organising it properly.||10||33|
|Find Date of highest and Second highest Values & lowest values in a Range Excel formula or VBA||4||27|
|Excel Formula to Iterate||4||10|
|In Excel 2007, how do I modify this formula so that the total number of question marks are printed out in a cell?||2||6|