If you want to auto fill color specific range using for loop VBA. In this article you will learn for loop in VBA meeting certain condition.
The idea is if range A1:A20 contains anything text or number then excel for loop will auto fill the blank cells.
Following is the snapshot of data in column A:
To automatically fill the color in blank cells, we need follow the below steps:
For x = 1 To 20
If Selection.Value = "" Then
.Color = 65535
In this way we can use VBA to auto fill color using for loop.
The applications/code on this site are distributed as is and without warranties or liability. In no event shall the owner of the copyrights, or the authors of the applications/code be liable for any loss of profit, any problems or any damage resulting from the use or evaluation of the applications/code.