Does anybody have a similiar code out there as the below which only counts the number of characters within formulas of a spreadsheet?
For example, cell A1 has the value of '310', but the formula to get the result of '310' is 431 characters in length.
I am using Excel 2010.
Thanks in advance.
For example, cell A1 has the value of '310', but the formula to get the result of '310' is 431 characters in length.
Code:
Sub CountCodeLines()
Dim VBCodeModule As Object
Dim NumLines As Long, N As Long
With ActiveWorkbook
For N = 1 To .VBProject.VBComponents.Count
Set VBCodeModule = .VBProject.VBComponents(N).CodeModule
NumLines = NumLines + VBCodeModule.CountOfLines
Next
End With
MsgBox "Total number of lines of code in the project = " & NumLines, , "Code Lines"
Set VBCodeModule = Nothing
End Sub
I am using Excel 2010.
Thanks in advance.