get list of modules name in Excel vba

description: vba to get list of modules name

code of vba to get list of module names

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Private Sub getAllModuleNames()

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
Cells(40, 1).value = modName

Set wb = Nothing

End Sub

more on search4fan.github.io