HELP! Do you know what this VBA code is doing?! RRS feed

  • Question

  • Hi guys.

    I am pmmd861, I am new here. Nice to meet you all!

    Could anyone help me with this VBA Excel
    code, please?

    So, i ve got the
    excel spreadsheet from someone else, and i need to understand the code there so that i could slightly rebuild it in the future. But there is some piece of code that i ve never seen and i have no idea how it works!

    Here is the extract from the

    In the Calibrate sub i have the code


        Sheets("EL 1").Select
        ActiveCell.FormulaR1C1 = "1"


    This bit is simple.

    But when


        ActiveCell.FormulaR1C1 = "1"


    is executed the code changes the value in the cell H9 AND after that CALLS the user defined FUNCTION in another module! My question is WHY? This is not how you call the function, right? Does it have something to do with windows programming language (i think it called API functions)?

    Also, it repeats the function many times, as if it is driven by some external loop (but there is no any cpde the loop).

    I tried to delete ALL the code in ALL modules and just to leave this bit – but it still calls the function!

    Also, there is the same code for another sheet, but on that sheet when one cell is changed it calls the function and when another cell is changed it does NOT call this function. Please, give me a hint where to look for the answer! I searched for
    Application. properties in the code and in the ThisWorkbook module and didn’t find anything! Also, there are no any classes in this project.

    Does this behaviour resemble something that you know?

    Thanx for your help guys!


    Saturday, November 28, 2009 7:15 PM


All replies