5

In Excel, the built-in cell styles are grouped. There is "Good, Bad and Neutral", "Data and Model", "Themed Cell Styles", etc:

enter image description here

Is there a way to interact with these groups? Like, can I delete an entire group? Can I create a group and add my own styles to it? Can I add styles to a preexisting group? Preferably via VBA.

I've looped through the styles in VBA (For Each st in Activeworkbook.Styles) and inspected their properties, but couldn't find any difference between the styles belonging to one group or to another group. The Parent property seems always empty - or whatever <No Variables> means.

Many thanks

ElRudi
  • 374
  • 1
  • 3
  • 15
  • you can find some useful info on a question I posted a while back https://superuser.com/questions/1291085/delete-all-custom-cell-styles-excel – PeterH Mar 30 '20 at 11:35
  • Thanks @PeterH for your comment. I'd seen that question and have actually used it when I had to get rid of the 60k custom styles I found in a recent workbook :D. In this case, however, I'm asking about creating/using/editing the *groups* that the builtin styles shown in. – ElRudi Apr 06 '20 at 14:16
  • When it comes to vba I ask more than I answer, maybe a bounty will get you a solution... – PeterH Apr 06 '20 at 15:25
  • @ElRudi,, if you are looking to delete `Predefined Style ` like `Normal2 ` and others then move mouse to style to highlight them, Right click and on pop up menu you find 4th command is DELETE,, u find this with most of `Predefined Styles`, as well U can modify them & create by users can be handles in the same way ☺ – Rajesh Sinha Apr 07 '20 at 06:06
  • Thanks @PeterH for putting up that bounty! – ElRudi Apr 07 '20 at 20:29
  • @RajeshS: thanks for your comment, but that's not what I'm trying to do. I'm trying to edit the *groups* here. – ElRudi Apr 07 '20 at 20:31
  • @ElRudi,, I don't think that user can delete Built-in Style groups, unless having any cheat sheet or the original source code ,, but I've one macro deletes all style except NORMAL,,, if this works for you then confirm through comments ☺ Or u may try this,, `If styl.BuiltIn = Ture Then styl.Delete End If` – Rajesh Sinha Apr 08 '20 at 05:32

1 Answers1

0

Unfortunately, you can't, although it would be a good addition (may be not the answer you wanted to get...)

There are predefined Cell style groups, and user defined Cell styles go to a group named Custom. There is no way of renaming the groups, or of selecting which group does a style belong to. The most you can do is deleting a predefined style, with Right click on a style -> Delete.

Source:

https://social.technet.microsoft.com/Forums/en-US/5c486888-c86b-4953-84a7-7b635765dbf8/cell-style-grouping?forum=excel

and same questions by the same person:

https://answers.microsoft.com/en-us/msoffice/forum/all/cell-style-grouping/0c071adb-552c-449f-a396-4b5408ae239b

https://www.mrexcel.com/board/threads/cell-style-groupings.845676/