COMMANDBAR - File Documentation Part II - module list proced

itr674

Well-known Member
Joined
Apr 10, 2002
Messages
1,786
Office Version
  1. 2016
Platform
  1. Windows
This post goes with "Commandbar-File Documentation Part I" posted earlier.

The module, procedure and worksheet code names list on a worksheet using this code.

How can I stop the sheet name listing, I only need the module and procedure title?<pre>Sub Macro_List_All_Subs_and_Functions()

Dim MasterVBComp As VBComponents
Dim SingleVBComp As VBComponent
Dim VBCodeMod As CodeModule
Dim LineCount As Integer
Dim LineNo As Integer

On Error GoTo AddSheetError
Sheets("fil-Macro List-3").Select
On Error GoTo 0

With Sheets("fil-Macro List-3").Cells
With Range("A2:B200")
.ClearContents
'.Clear ' this clears everything, text and formats
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
'.Columns.AutoFit
'.Rows.AutoFit
.WrapText = False
.Orientation = 0
.AddIndent = False
.ShrinkToFit = False
.MergeCells = False
.Font.Name = "Arial"
.Font.Size = 8
.IndentLevel = 0
.Range("A1").Select
End With
End With

'Cells.Select
'Selection.Delete Shift:=xlUp ' I would like to know what this does
'Range("A1").Select

Set MasterVBComp = ThisWorkbook.VBProject.VBComponents

LineCount = 0
LineNo = 0

For Each SingleVBComp In MasterVBComp

LineNo = LineNo + 1

Worksheets("fil-Macro List-3").Cells(LineNo, 1).Value = SingleVBComp.Name

Set VBCodeMod = ThisWorkbook.VBProject.VBComponents(SingleVBComp.Name).CodeModule

With VBCodeMod
StartLine = .CountOfDeclarationLines + 1
Do Until StartLine >= .CountOfLines
LineNo = LineNo + 1

Worksheets("fil-Macro List-3").Cells(LineNo, 2).Value = .ProcOfLine(StartLine, vbext_pk_Proc)
'Msg = Msg & .ProcOfLine(StartLine, vbext_pk_Proc) & Chr(13)
StartLine = StartLine + .ProcCountLines(.ProcOfLine(StartLine, vbext_pk_Proc), vbext_pk_Proc)
Loop
End With

Next
Exit Sub</pre>
This message was edited by em on 2003-01-31 23:53
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.

Forum statistics

Threads
1,203,067
Messages
6,053,334
Members
444,654
Latest member
Rich Cohen

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top