cancel
Showing results for 
Search instead for 
Did you mean: 

Macro :Copy range of values from one KF to another

Former Member
0 Kudos

I need to write a macro which would copy a range of values from one keyfigure and to another.

The Macro will copy the horizon of a selected key figure or only highlighted cells, to another key figure. Highlighting the selected portion will function like a copy/paste, to bring the values from one key figure to another key figure.

Awaiting suggestions.

Regards,

Kunal

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member209769
Active Contributor
0 Kudos

Hi Kunal,

Macros always work with pre-defined time horizons, so this is not a straight forward requirement. However, you could do the following:

1) Ask the users to select the columns (time periods) for which they want the KF copy to take place.

If they want the complete horizon to be copied, they should select all the columns, or otherwise you could give them a different macro which could cover the complete horizon of the planning view.

2) In a macro, do the calculations of the copy from KF1 (source) to KF2 (destination) after checking that the particular column was selected by the user. Users need to push a pushbutton for this, which you couls provide them.

So, you need to basically write the following logic FOR THE COMPLETE HORIZON in the macro:-

(a) Check if the column is marked. Use Operator/Funtion as IF "COLUMN_MARKED( ACT_COLUMN ) = 1".

(b) If (a) is satisfied, then you copy from KF1 to KF2, else do nothing.

In the macro definition, DO NOT tick the option " No Direct Execution".

Also, assign some pushbutton to the macro. Users would need to push this to execute the macro for their specified horizons (which they specified by selecting the rows).

If users do not want to select all the columns when they want to copy the full horizon, you could create a separate macro with a different pushbutton. This macro would do the copy for the full horizon without checking if column is marked or not. The users can then use this pushbutton to execute this KF copy macro for the full horizon.

Hope this helps.

In case of further doubts on this, do let me know.

Thanks - Pawan