View Single Post
  #5   Report Post  
bigdaddy3
 
Posts: n/a
Default

Hi Hayeso, i tried that but as the sheet and workbook are protected it brings
up the dialog box "unable to set the color prop of interior class"
--
BD3


"Hayeso" wrote:

Select Tools...Macro...Visual Basic Editor
Select View...Project Explorer (If Project Explorer not already visible)
Expand the VBAProject for your workbook and double click on the ThisWorkbook
icon

Place the following code in the code window (RHS)
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Dim aRange As Range, aCell As Range, aSheet As Worksheet
Dim aColour As Single
aColour = vbRed
For Each aSheet In ThisWorkbook.Sheets
Set aRange = aSheet.UsedRange
If aRange.Cells.Count 1 Then
For Each aCell In aRange

If aCell = "" Then
aCell.Interior.Color = aColour
End If
Next
End If
Next
End Sub


Select File...Close and return to Microsoft Excel

Close the workbook and save when asked.


"bigdaddy3" wrote:

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
--
BD3