vba 在excel中使用VBA将所有工作表的填充颜色设置为“无填充”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/40973322/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Set all sheets' fill color to "No Fill" using VBA in excel
提问by Eghbal
How can I Set all sheets fill color to No fillusing VBA in excel (all cells). Same as select all sheets, Select all cells (Control+A) and change fill colorto No fill.
如何将所有工作表填充颜色设置为No fill在 excel 中使用 VBA(所有单元格)。与选择所有工作表相同,选择所有单元格 (Control+A) 并更改fill color为No fill。
回答by Jordan
Untested but should do the job:
未经测试,但应该做的工作:
Sub No_Fill_Wb()
Dim ws as worksheet
For each ws in Thisworkbook.Worksheets
ws.Cells.Interior.ColorIndex = 0
Next ws
End Sub
回答by Corrie Steele
I used "0" in my code (see below) working with Excel 2016 and it turned my columns black.
我在使用 Excel 2016 的代码中使用了“0”(见下文),它将我的列变成黑色。
Master.Columns(Col_Start).Interior.Color = 0
Using "xlNone" per below, however, did work for me.
但是,在下面使用“xlNone”确实对我有用。
Master.Columns(Col_Start).Interior.Color = xlNone
回答by Prashant Mallick
Hey guys you can use this for selecting "No Fill" option "ThisWorkbook.Sheets(1).Interior.Color = xlNone" otherwise if you want to set any background color you can use this way "ThisWorkbook.Sheets(1).Interior.Color = vbgreen"
嘿伙计们,您可以使用它来选择“无填充”选项“ThisWorkbook.Sheets(1).Interior.Color = xlNone”,否则如果您想设置任何背景颜色,您可以使用这种方式“ThisWorkbook.Sheets(1).Interior .color = vbgreen"

