View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Stephen Newman[_2_] Stephen Newman[_2_] is offline
external usenet poster
 
Posts: 18
Default background colour.

On Mon, 21 Jul 2008 13:44:47 +0800, "shiro" wrote:

From Chip Pearson's site:

Put the following code in 'thisWorkbook'. The selected cell in all
your sheets will then change color, and the cell which was left will
revert back to no color.



Option Explicit

Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal
Target As Excel.Range)
Static OldCell As Range

If Not OldCell Is Nothing Then
OldCell.Interior.ColorIndex = xlColorIndexNone
End If

Target.Interior.ColorIndex = 6

Set OldCell = Target

End Sub


I have some cells with background colour.
I want the background colour change automatically
when the value of the cell being updated,but when
printing the the sheet,the background colour is disappear.
How to do that?
The cell position is random.
Thank's id advance.

Rgds,

Shiro.