Is there a way to change the Background color into xlNone
,
for example to the entire sheet. I see that you can put a background image...
But how can you change the color for all cells in the sheet?
Click the worksheet that you want to display with a sheet background. Make sure that only one worksheet is selected. On the Page Layout tab, in the Page Setup group, click Background. Select the picture that you want to use for the sheet background, and then click Insert.
You can do this quite easy with this code:
Public Sub Demo()
'set color
WorksheetName.Cells.Interior.ColorIndex = 1 'black
'clear color
WorksheetName.Cells.Interior.ColorIndex = xlColorIndexNone
end sub
Or if you don't need VBA, just click at this little icon in the corner:
and select a color, or to use no color - using right click menu or ribbon menu.
Just because of the other answers, I want to remind - it is not necessary to use selections! This is bad macro-recorder style. There are only few occations, where using selections is necessary or a good idea. You can always just use a specific range.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With