Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default background colour.

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.


  #2   Report Post  
Posted to microsoft.public.excel.programming
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.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default background colour.

Mr Stephen,
Appreciated your help.I have not visited Mr Chip's page,
just hope I'll get the answer here.

I need more condition,I want turn the OldCell colour to
another colour if the cell's value was updated by user,
if it's not updated the colour is xlColorIndexNone,how to
modify the code?
Thank's in advance.

Rgds,

Shiro


"Stephen Newman" wrote in message
...
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.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
change a cell background colour to my own RGB colour requirements Stephen Doughty Excel Discussion (Misc queries) 4 June 16th 06 01:08 PM
How to filter using background colour? chrisk Excel Worksheet Functions 1 February 13th 06 03:38 PM
Combo box background colour John Davies Excel Programming 1 September 28th 05 12:30 PM
Background colour using VB Tom Ogilvy Excel Programming 2 September 15th 04 08:58 PM
Background colour using VB No Name Excel Programming 0 September 15th 04 02:51 PM


All times are GMT +1. The time now is 11:38 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"