View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Ben McClave Ben McClave is offline
external usenet poster
 
Posts: 173
Default Excel 2003 - VBA to get a list of Module names in the project

Hello,

Try this code. It should be easy to adapt it to your needs.

Sub GetModules()
Dim modName As String
Dim wb As Workbook
Dim l As Long

Set wb = ThisWorkbook

For l = 1 To wb.VBProject.VBComponents.Count
With wb.VBProject.VBComponents(l)
modName = modName & vbCr & .Name
End With
Next

MsgBox "Module Names:" & vbCr & modName

Set wb = Nothing

End Sub