VBA code or other solution to color cells white if they contain no data

David77

Board Regular
Joined
Jun 24, 2020
Messages
109
Office Version
  1. 365
Platform
  1. Windows
Hello everybody,

I am currently facing an issue. I would like to create a code that colors my cells with a complete white background and no borders if they contain no data (numbers, letters, signs or anything else).

Please see the following snip:

1596625039126.png


For the blank cells from Cell A135-D135 and below, I would thus like for them to be automatically turned into the same white background as is seen to the right of them because they have no data in their cells.

Is there any way in which I can do this through a VBA code for example?

I would greatly appreciate any assistance I can get! Thank you so much everybody :)

Best regards,
David
 
Unfortunately, Conditional Formatting does not affect the default gridlines.

I actually found out how to do it through conditional formatting to affect the gridlines.

However, I don't know how to enter a code that says basically:

If the value of the cells taken from the other sheet is not blank --> create green gridlines/borders
If the value of the cells taken from the other sheet is blank --> create white gridlines/borders and background

How would I do this?
 
Upvote 0

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
Please answer my question in post#10
 
Upvote 0
Please answer my question in post#10
This is another topic that builds on the previous topic (I couldnt edit or delete the other topic I created, so please feel free to remove it if you can do so). I left out a lot of information and found a lot of new issues regarding my gridlines and conditional formatting and VBA coding, which is why I found it necessary to create this topic.
 
Upvote 0

Forum statistics

Threads
1,224,759
Messages
6,180,813
Members
452,996
Latest member
nelsonsix66

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
Back
Top