简体   繁体   中英

Access the interior color of a cell style from VBA?

My workbook has a cell style that is called "Normal Formula". Is it possible to access the interior color of this cell style from VBA?

I've tried:

rCell.Interior.Color = ActiveDocument.Styles("Normal Formula").Interior.Color

but VBE gives me an object required error.

The code I found was from msdn for word. When I replaced activedocument with thisworkbook, the code worked.

rCell.Interior.Color = ThisWorkbook.Styles("Normal Formula").Interior.Color

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM