Macro help, load values from one range to another range in a dynarange

    Macro help, load values from one range to another range in a dynarange

    Hello groupmembers,


    Anybody good at Macro? I need help.


    In a report I have a dynarange, with 2 named ranges. I want to execute a macro, when clicking on a button.

    The macro should copy values from one named range inside the dynarange to another named range inside the same dynarange.


    I was thinking of something like this, but it doesnt work

    function bntLoad ()
    {
    $varValue = activeworkbook()->names->item("rngSource")->value;
    activeworkbook()->names->item("rngtarget")->value=$varValue;

    return __recalc();
    }


    Can anybody tell my why ?


    best regards

    Sven