+ Reply to Thread
Results 1 to 3 of 3

Format Cell Colour if contents are Changed ?

  1. #1
    MAS
    Guest

    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. #2
    Tom Ogilvy
    Guest

    RE: 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. #3
    MAS
    Guest

    Re: Format Cell Colour if contents are Changed ?

    Thanks Tom, Thats sorted it.


    "Tom Ogilvy" <[email protected]> wrote in message
    news:[email protected]...
    > 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1