Compare and highlight differences in 2 worksheets in same workbookand list differences in 3rd worksh

  • Thread starter Thread starter Joshua Houck
  • Start date Start date
In message <[email protected]> of Tue, 16 Aug 2011
11:59:52 in microsoft.public.excel.programming, Martin Brown <|||newspam
|||@nezumi.demon.co.uk> writes
In message said:
Walter Briscoe pretended :
[snip]

I have two known unsatisfied needs for Excel:

1) A means of dumping VBA variables TO A TEXT FILE. (I have lots of
tools which handle text files.) Visual Basic Editor's View/Locals window
shows the information I want, but not in a convenient format. Ctrl-A and
Ctrl-C support would probably give me much of what I want;

[snip]

Thank you for your efforts. In principle, it could be used to reference
a lists of known member names in known types. The effort of generating
such lists is more than I am prepared to do.
I don't know of a way to probe the list of names that a given object
supports from VBA, but you can try all names and then output the ones
that have sensible non null values. I think it will drive you mad, to
do this, but the following code will do pretty much what you ask for.

It obviously needs refinements - it just gives the internal numeric
code of VarType() rather than indexing into an array of type names.

The code below is just a proof of concept using error trapping to allow
attempts to fetch non existent fields from an object. Obviously a full
version would read the whole range of possible fields into a array of
variants and then display only the ones that are not empty/null.



Sub Test(o As Object)
On Error Resume Next
sAddIdent = o.Addident
sAllowEdit = o.AllowEdit
sColumn = o.Column
sCountLarge = o.CountLarge
sFormula = o.Formula
sFormulaR1C1 = o.FormulaR1C1
sLeft = o.Left

Debug.Print aAddIdent, VarType(sAddIdent)
TypeName(sAddIdent) might be useful here

[snip]
BTW: Is there any interest in a McCabe CCI metric generator for finding
maintenance hotspots in inherited VBA code?

I am sorry I don't know what you are talking about.
CCI is an acronym for many terms in Wikipedia.
 
Hey there Walter

I think CCI stands for:

Cyclomatic Complexity Indicator - McCabe Cyclomatic Complexity (aka CCI or
CCN).

http://en.wikipedia.org/wiki/Cyclomatic_complexity

Cyclomatic complexity (or conditional complexity) is a software metric
(measurement). It was developed by Thomas J. McCabe, Sr. in 1976 and is used
to indicate the complexity of a program. It directly measures the number of
linearly independent paths through a program's source code. The concept,
although not the method, is somewhat similar to that of general text
complexity measured by the Flesch-Kincaid Readability Test.

Cyclomatic complexity is computed using the control flow graph of the
program: the nodes of the graph correspond to indivisible groups of commands
of a program, and a directed edge connects two nodes if the second command
might be executed immediately after the first command. Cyclomatic complexity
may also be applied to individual functions, modules, methods or classes
within a program.



HTH

Mick.
 
Back
Top