Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
MAS MAS is offline
external usenet poster
 
Posts: 19
Default Format Cell Colour if contents are Changed ?

Hi,

I have a multi worksheet workbook with one sheet for each day of the month.

I want to have the background colour of indivdual cells in a range of cells
change IF anyone changes the content of individual cells in that range of
cells.

Any ideas on some VBA to achieve this please ?


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Format Cell Colour if contents are Changed ?

Alt + F11 to get to the VBE

look in the project explorer for your workbook/project
double click on the thisworkbook entry to bring up the Thisworkbook module

at the top of that module, select Workbook from the left dropdown and Change
from the right dropdown.

this should place the workbook Level change event in the module.

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)

End Sub

this will fire whenever a cell is edited.

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
if not intersect(target,sh.Range("B9:Z20")) is nothing then
target.Interior.colorIndex = 6
end if
End Sub

as an example.

See Chip Pearson's site for an overview of events
http://www.cpearson.com/excel/events.htm

--
Regards,
Tom Ogilvy



"MAS" wrote:

Hi,

I have a multi worksheet workbook with one sheet for each day of the month.

I want to have the background colour of indivdual cells in a range of cells
change IF anyone changes the content of individual cells in that range of
cells.

Any ideas on some VBA to achieve this please ?



  #3   Report Post  
Posted to microsoft.public.excel.programming
MAS MAS is offline
external usenet poster
 
Posts: 19
Default Format Cell Colour if contents are Changed ?

Thanks Tom, Thats sorted it.


"Tom Ogilvy" wrote in message
...
Alt + F11 to get to the VBE

look in the project explorer for your workbook/project
double click on the thisworkbook entry to bring up the Thisworkbook module

at the top of that module, select Workbook from the left dropdown and
Change
from the right dropdown.

this should place the workbook Level change event in the module.

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As
Range)

End Sub

this will fire whenever a cell is edited.

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As
Range)
if not intersect(target,sh.Range("B9:Z20")) is nothing then
target.Interior.colorIndex = 6
end if
End Sub

as an example.

See Chip Pearson's site for an overview of events
http://www.cpearson.com/excel/events.htm

--
Regards,
Tom Ogilvy



"MAS" wrote:

Hi,

I have a multi worksheet workbook with one sheet for each day of the
month.

I want to have the background colour of indivdual cells in a range of
cells
change IF anyone changes the content of individual cells in that range of
cells.

Any ideas on some VBA to achieve this please ?





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
How do i change the colour of a cell according to the contents? ChrisC Excel Discussion (Misc queries) 2 October 10th 08 09:58 PM
Format changed when the details in cell changed angel Excel Worksheet Functions 9 July 15th 08 12:36 AM
Changing Cell Contents Colour Spiller Excel Discussion (Misc queries) 3 November 24th 06 01:40 PM
Change Colour on a Cell after another cell has been changed David Hardy Excel Discussion (Misc queries) 1 August 30th 06 04:15 PM
how to detect when cell contents has changed Tony Excel Programming 5 October 12th 04 03:29 AM


All times are GMT +1. The time now is 05:05 PM.

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"