auto color blank cells ,best solution

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

i would like to automatically color all blank cells unfilled which can vary
on each sheet at close of workbook,any suggestions .The total number of blank
cells will be no more than 100
 
Maybe you're looking for something like this. It works for cells A1:J4 on
Sheet 1, but you can change that as required:

For rwIndex = 1 To 4
For colIndex = 1 To 10
With Worksheets("Sheet1").Cells(rwIndex, colIndex)
If .Value = "" Then
Worksheets("Sheet1").Cells(rwIndex, colIndex).Select
With Selection.Interior
.ColorIndex = 6
.Pattern = xlSolid
End With
End If
End With
Next colIndex
Next rwIndex

You can refer to this code within an macro or at close, whichever is
prefered. Hope this helps.

-Chad
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top