Hi folks,
I am trying to delete all modules from my workbook except 2 or 3 that I need.
So I put this code together from research
I tried to follow the logic but, well I'm not sure how to make it workSub DeleteModulesExcept() Dim VBProj As VBIDE.VBProject Dim VBComp As VBIDE.VBComponent Set VBProj = ActiveWorkbook.VBProject For Each VBComp In ActiveWorkbook.VBProject.VBComponents If VBComp.VBProj.VBComponents("DontDelete1") or VBComponents("DontDelete2") Then 'Dont Delete Else VBProj.VBComponents.Remove VBComp End If Next End Sub
thank you if you can help or advise
dj