Quantcast
Channel: SCN : Discussion List - SAP Planning and Consolidation, version for SAP NetWeaver
Viewing all articles
Browse latest Browse all 5414

Members getting blown away after VBA Code

$
0
0

Dear BPC Friends,

 

I  have written a VBA code to distribute   the annual budget  to the 12 months of the budget year.  The client will enter annual budget in column highlighted in green color (screenshot attached)  and then click ‘Distribute’ macro. This macro will distribute  the annual budget number from Jan-Dec.

 

The VBA code is working fine, but when I press ‘Refresh’ all the columns disappear. Kindly see the attached screen for before and after refresh effect.  I already checked the FPMXLClient.

 

My code is

 

Sub BudDist()

Dim myCell As Range

Dim Data As Long

Dim lr As Long

Dim a

 

lr = Cells(Rows.Count, 11).End(xlUp).Row

For Each myCell In Range("K39:K" & lr)

    Data = myCell.Value / 12

    a = myCell.Row

    Range("N" & a & ":Y" & a).Value = Data

 

Next myCell

End Sub

Before & After Refresh.PNG

Kindly help me with solving this problem.

 

Thanks,

Rahul


Viewing all articles
Browse latest Browse all 5414

Trending Articles