PDA

View Full Version : rows formula



lior03
08-08-2006, 01:38 PM
hello
i have this macro which gives a list of all macros in a workbook.
how can i make the row formula be filled automatically down the list.
i mean the column under num
thanks
Sub GetVbProj()
Application.ScreenUpdating = False
On Error GoTo err
Dim num As Integer
Dim oVBC As Object
Dim wb As Workbook
Dim i As Integer
Application.StatusBar = "leghty macro ,please wait"
x = 2
For Each wb In Workbooks
Sheets("projects").Activate
Cells.clear
For Each oVBC In Workbooks(wb.name).VBProject.VBComponents
If Workbooks(wb.name).VBProject.Protection = vbext_pp_none Then
Call GetCodeRoutines(wb.name, oVBC.name)
End If
Next
Next
With Sheets("projects")
.[A1].Resize(, 4).Value = Array("Workbook", "Module", "Procedures", "num")
.[A2].Resize(UBound(aList, 2), UBound(aList, 1)).Value = _
Application.Transpose(aList)
.Columns("A:D").Columns.autofit
With Cells
.Font.Bold = True
.HorizontalAlignment = xlLeft
Application.StatusBar = ""
Cells.clearcomments
Cells.Font.ColorIndex = 1
Dim lngRow As Long
Dim lngcom As Long
lngRow = ActiveSheet.Range("a1").End(xlDown).row
lngcom = ActiveSheet.Range("a1").End(xlToRight).Column
Cells(lngRow + 2, lngcom).FormulaR1C1 = "=countA(R2C:R[-1]C)"
For i = 2 To lngRow
Cells(i, lngcom).FormulaR1C1 = "=rows(R1C:R[-1]C)"
Exit Sub
err:
If err.number = 9 Then
Sheets.Add.name = "projects"
End If
Next
End With
End With
Application.ScreenUpdating = True
End Sub

lucas
08-08-2006, 01:47 PM
What is

vbext_pp_none

Bob Phillips
08-08-2006, 02:23 PM
What is

vbext_pp_none


A constant from the VBA Extensibility library, signifying no protection.

lucas
08-08-2006, 06:22 PM
Thanks Bob.....haven't looked at a lot of code dealing with the vbe obviously