cancel
Showing results for 
Search instead for 
Did you mean: 

EPM Formatting Through VBA Code (Macros) - SAP BPC 10.0

karan_kothari2
Participant
0 Kudos

Hello Experts,

In one of our BPC template, number formatting for figures have been done through VBA code (Refresh Macro) as mentioned below which applies to full sheet.

and works proper:


But there is an additional requirement with respect to some of the columns where formatting is different (color changes) for that we have added the below code:


Post refreshing the template it is giving below error with same additional line item:

Any suggestions for code syntax.

Thanks,

Karan

Accepted Solutions (1)

Accepted Solutions (1)

former_member186338
Active Contributor
0 Kudos

Sorry, but Columns return range object having property:

NumberFormat

Not

number_format

karan_kothari2
Participant
0 Kudos

Hi Vadim,

I have tried with your suggestion and template is also getting refresh but there is no effect for this additional line item as it is not getting applied to mentioned particular range.

Thanks,

Karan

former_member186338
Active Contributor
0 Kudos

The code:

Range("CQ:DG").NumberFormat = "[Red]#,##0.00;-#,##0.00;- ;"

is absolutely correct and is working in my test macro. It will make positive numbers red (strange idea by the way).

Why it's not working in your code? May be ElseIf is not true...

And have to repeat - it's a bad idea to ask new question without reaction on previous one!

former_member186338
Active Contributor
0 Kudos

Or may be formatting by this line is overwritten by the next code (not shown)!

That's why I always as to post full code in text mode using code button!

karan_kothari2
Participant
0 Kudos

Hi Vadim,

Your are correct, It was getting overwritten by the latter part of the code.

The same has been rectified and it is working as per requirement.

Thanks,

Karan

Answers (1)

Answers (1)

former_member186338
Active Contributor
0 Kudos

P.S. Please accept answer on your previous question!