strange problem with pivot formating

ektorakos

New Member
Joined
Nov 16, 2016
Messages
9
Hello everyone,

I have a strange formating problem with a pivot.

The left side of the pivot has 3 fields all collapsed (so you can see the + on the left)

If i put color to one cell from the list manually , i can still expand and recollapse the field and the cell keeps the formating

however in this case i have made a vba sub that checks every cell in the left collumn of the pivot and compares it with a list in another sheet with formats and if the string is the same then it copies the format to the pivot cell.

It works perfectly , BUT when i try to expand a field everything goes back to unformatted state!!

does anyone understands why this is happenning?

The pivot was made from the macro recorder and then i modified it to be dynamic acording to the data sheet.

The vba code for the formatting is a simple loop within loop


For Each i In PivR (for every cell in the left column of the pivot)
For Each k In PivD (for every cell in the list with the wannabe formats)
If i = k Then
k.Copy
i.PasteSpecial xlPasteFormats
GoTo Here
Else
End If

Next k
Here:
Next i
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,164,272
Messages
5,836,326
Members
430,420
Latest member
Sensen

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top