hello
is there a way through vba to get the list of macros in a workbook.
i mean the list i get when i predd alt+f8.
maybe by using :
[VBA] Application.Dialogs[/VBA]
thanks
hello
is there a way through vba to get the list of macros in a workbook.
i mean the list i get when i predd alt+f8.
maybe by using :
[VBA] Application.Dialogs[/VBA]
thanks
moshe
Moshe,
This is the same question you asked in:
http://www.vbaexpress.com/forum/showthread.php?t=6560
Patrick
Hey Moshe,
I found this at http://www.cpearson.com/excel/vbe.htm and I modified it a little for more functionality. Tell me if it works
[VBA]Option Explicit
Sub ListProcedures()
Dim VBComp As VBComponent
Dim VBCodeMod As CodeModule
Dim StartLine As Long
Dim Msg As String
For Each VBComp In ThisWorkbook.VBProject.VBComponents
Set VBCodeMod = ThisWorkbook.VBProject.VBComponents(VBComp.Name).CodeModule
Msg = Msg & VBComp.Name & vbCrLf
With VBCodeMod
StartLine = .CountOfDeclarationLines + 1
Do Until StartLine >= .CountOfLines
Msg = Msg & "-" & .ProcOfLine(StartLine, vbext_pk_Proc) & Chr(13)
StartLine = StartLine + .ProcCountLines(.ProcOfLine(StartLine, vbext_pk_Proc), vbext_pk_Proc)
Loop
End With
Msg = Msg & vbCrLf
Next VBComp
MsgBox Msg
End Sub[/VBA]
New to the forum? Check out our Introductions section to get to know some of the members here. Feel free to tell us a little about yourself as well.