Talk:Visual Basic for Applications/Redundant Variables List

Hello,

A few things - I am not a programmer --- I dabble.

I have created a module [ redundantcode ] Put the code into it. Added Option Private Module ' sheets 1 to 5 ' the reference [Microsoft Visual Basic for Applications Extensibility 5.3 ] '        I also have '        [Visual Basic for Applications] '        [Microsoft Excel 16.0 Object Library] '        [OLE Automation] '        [Microsoft Office 16.0 Object Library] '        [Microsoft Forms 2.0 Object Library] Compiled OK

Ran the code and the form opens with found the redundant variable - bOneToFind As Boolean

'' ===================================

So now I follow this process and add a new module to my active workbook the reason for this need. :)

Run and instant error code that I can't work out. Run-time error Invalid procedure call or argument sProj = sProj & VBMod.Lines(1, nLines)         'project string '' ===================================

I have a lot of modules a couple of forms and about 25 sheets. One thing I have noticed is that the objects list

Sheet1 (namesomething) etc. Sheet14(Sheet3) etc Sheet2(namesSomethingElse) Sheet20(Sheet5) etc.

'' ===================================

Seems that I have sorted the issue, I did a few things first - Read the instructions again and RAN Debug This found a couple of issues.

I then went through all sheet and module code and ensured the headers were all identical putting in 'OPTION EXPLICIT'

In each module; then ran the Debug again.

Ran the redundant program again and noted the output was working. MAGIC Thanks

'' ===================================

G6SGA (discuss • contribs) 11:57, 20 February 2020 (UTC) Stephen G6SGA

Hi, I am not sure why you had problems with it, but most often I find that having an excess of references is not a bad thing. There is a list of the ones that I have made use of so far on the introduction page. You should try the formatter too. Regards, Armchair (discuss • contribs) 09:18, 21 May 2020 (UTC)